I have just installed Umbraco version 7.6.5 via NuGet including the brand new starter kit. After compiling and running the site I encountered the following error:
The type or namespace 'Home' does not exist in the namespace 'Umbraco.Web.PublishedContentModels'
I have than dumped everything and started clean all over again with the same result.
I am just curious to know whether I am the only one experiencing this problem...
My question is, whether I can ignore those errors as VS builds it without errors or whether it's better not to rely on it since there are other errors as well:
The errors are there in Visual Studio because of the Models Builder. I believe the fresh install has it configured to purelive so when the site runs the models exist, hence no errors.
The downside, is Visual Studio doesn't provide intelli-sense for the models. In addition I don't believe you'd be able to use them in controllers (I may be mistaken).
What you can do, is change to Dll, or another mode however Dll mode requires you logging into the back office and generating the models each time you change a document type.
Yep, I would expect that error when you first run the site. The "front end" of the site is going to throw that error until you log into Umbraco and generate the models.
So, if you go to /umbraco and login, then go to the developers section, one of the tabs at the top reads "Models Builder", if you select that and then click generate models it should resolve the issue.
This will need to be done each time you create a new document type, or change a document type so the models are up to date.
What happens when I'm creating new document types in my productive environment once the Website is online? I reckon this is not leading to any problems since it is a conflict within Visual Studio. Am I right?
I'm just wondering if this method is the best way to handle this issue in Umbraco CMS for this and the future versions or whether there is going to be another solution?
Models builder has a variety of different options for it's configuration. Personally, I haven't found my preferred method of using it. What I would do in your situation is possible use DLL mode in my development environment and maybe consider using purelive mode in production.
That's a good advice. I will stick to the method of running the production in PureLive mode.
Only problem I came accross now is, that I get an error when I Switch back to PureLive mode. After recompiling and publishing I get the following error on the production Server:
Compiler Error Message: CS0433: The type 'Umbraco.Web.PublishedContentModels.Home' exists in both 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\b8a17847\1ff0dc10\assembly\dl3\d0cd19b9\00bb796dbc1cd301\Umbraco.Web.PublishedContentModels.DLL' and 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\b8a17847\1ff0dc10\AppWeb_all.generated.cs.8f9494c4.tlkj40i2.dll'
By looking at your error, trying clearing out the Temp directory located under the /APP_Data folder. Also, recycle your app pool "if" your project is wired up to IIS. And finally rebuilding the project out of Visual Studio.
Error in Starterkit
Umbraco version 7.6.5 assembly: 1.0.6428.37121
Hi there,
I have just installed Umbraco version 7.6.5 via NuGet including the brand new starter kit. After compiling and running the site I encountered the following error:
The type or namespace 'Home' does not exist in the namespace 'Umbraco.Web.PublishedContentModels'
I have than dumped everything and started clean all over again with the same result.
I am just curious to know whether I am the only one experiencing this problem...
Please let me know Thanks
My question is, whether I can ignore those errors as VS builds it without errors or whether it's better not to rely on it since there are other errors as well:
The errors are there in Visual Studio because of the Models Builder. I believe the fresh install has it configured to purelive so when the site runs the models exist, hence no errors.
The downside, is Visual Studio doesn't provide intelli-sense for the models. In addition I don't believe you'd be able to use them in controllers (I may be mistaken).
What you can do, is change to Dll, or another mode however Dll mode requires you logging into the back office and generating the models each time you change a document type.
Thank you Nik for your reply and suggestion.
Unfortunately when I switch from "pureLive" to "Dll" the site does not start any more. I get the following error:
Hi Edgar,
Yep, I would expect that error when you first run the site. The "front end" of the site is going to throw that error until you log into Umbraco and generate the models.
So, if you go to /umbraco and login, then go to the developers section, one of the tabs at the top reads "Models Builder", if you select that and then click generate models it should resolve the issue.
This will need to be done each time you create a new document type, or change a document type so the models are up to date.
Nik
Hi Nik,
great! Thanks for your help.
What happens when I'm creating new document types in my productive environment once the Website is online? I reckon this is not leading to any problems since it is a conflict within Visual Studio. Am I right?
I'm just wondering if this method is the best way to handle this issue in Umbraco CMS for this and the future versions or whether there is going to be another solution?
Models builder has a variety of different options for it's configuration. Personally, I haven't found my preferred method of using it. What I would do in your situation is possible use DLL mode in my development environment and maybe consider using purelive mode in production.
To learn more about the different configuration options and behaviours, I'd advise this link: https://github.com/zpqrtbnk/Zbu.ModelsBuilder/wiki
At some point this will be merged into the main documentation here on Our, but for now it's a great repository of information.
That's a good advice. I will stick to the method of running the production in PureLive mode.
Only problem I came accross now is, that I get an error when I Switch back to PureLive mode. After recompiling and publishing I get the following error on the production Server:
Compiler Error Message: CS0433: The type 'Umbraco.Web.PublishedContentModels.Home' exists in both 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\b8a17847\1ff0dc10\assembly\dl3\d0cd19b9\00bb796dbc1cd301\Umbraco.Web.PublishedContentModels.DLL' and 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\b8a17847\1ff0dc10\AppWeb_all.generated.cs.8f9494c4.tlkj40i2.dll'
By looking at your error, trying clearing out the Temp directory located under the /APP_Data folder. Also, recycle your app pool "if" your project is wired up to IIS. And finally rebuilding the project out of Visual Studio.
These steps may help.
Thanks for your reply.
In the meantime I managed to solve this issue by deleting the Umbraco.Web.PublishedContentModels.dll from the bin folder.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.