The type or namespace name 'Homepage' does not exist in the namespace 'Umbraco.Web.PublishedModels'
Hi,
I'm new to Umbraco and am facing a rather frustrating error. I downloaded the Umbraco 8.14.0 zip file and used Visual Studio 2019 to open it as a website. I was able to start the site up from Visual Studio and set up a custom installation and then followed a tutorial to create new Document Types and corresponding Templates. After a reboot when I try to start the site from Visual Studio now I face the error above with the name "Homepage" being the Document Type and Template I created. I've read a few things online about ModelsBuilder.ModelsMode and have tried setting it to PureLive, Dll, AppData and LiveAppData without any success. I can see in the AppData folder there is a file called models.generated.cs that looks as if it has the definitions for Homepage in it but it looks as if, for some reason, Umbraco is not using this file.
Keep in in AppData mode (or LiveAppData - just means doc type changes automatically regenerate the model classes into the app data folder - just AppData means you have to manually press the 'generate models' button in the developer section of Umbraco)
Anyway, in this mode to use the models in your Visual Studio solution and get intellisense etc, you need to 'show all files on disk' then you'll see the generated files from within visual studio, but greyed out, then right click them, include in project and rebuild...
I Hope you are using default Model Builder in you application which is PureLive. Just Double the check the Builder Builder Configuration in the webConfig File.
Also Try Below Steps.
Login into the CMS and go to the Setting Tab and Click on the
Model-Builder Section on the Right Panel.
Click on the Generate Model Button and than Stop the Application.
Rebuild the Application and start your application again.
Thank you both for your responses. Unfortunately no matter what I tried I couldn't get Visual Studio to launch the site (the error happens at compile time so there was no opportunity to do anything through the front end of the CMS). I started again this morning in a new folder with newly extracted files from the zip file and having set the ModelsMode to AppData I followed the tutorial to create a document type and then pressed the Generate Models button and can see a file called HomePage.generated.cs in the AppData | Models folder but once again I am still receiving the same error in Visual Studio when I stop execution and try to restart it even with the HomePage.generated.cs file included in the project.
I've now followed the instructions to start Visual Studio with a blank project and imported Umbraco from NuGet and have been able to create a new document type, stop the code execution and then restart it successfully so maybe it is a problem with opening the zip file in Visual Studio - I don't think for whatever reason it was going through a full build process.
Have you include the Home.Generated.Cs class In you project ?? If not you have to include the Home.Generated.cs class from Visual Studio and rebuild the application. Check if the error still exists .
Yes, HomePage.generated.cs was included in the project. I'm up and running now by using the NuGet package so am happy to proceed that way and will just ignore the zip file.
The type or namespace name 'Homepage' does not exist in the namespace 'Umbraco.Web.PublishedModels'
Hi,
I'm new to Umbraco and am facing a rather frustrating error. I downloaded the Umbraco 8.14.0 zip file and used Visual Studio 2019 to open it as a website. I was able to start the site up from Visual Studio and set up a custom installation and then followed a tutorial to create new Document Types and corresponding Templates. After a reboot when I try to start the site from Visual Studio now I face the error above with the name "Homepage" being the Document Type and Template I created. I've read a few things online about ModelsBuilder.ModelsMode and have tried setting it to PureLive, Dll, AppData and LiveAppData without any success. I can see in the AppData folder there is a file called models.generated.cs that looks as if it has the definitions for Homepage in it but it looks as if, for some reason, Umbraco is not using this file.
Thanks in advance for any help.
Gareth Barnes
Hi Gareth
Keep in in AppData mode (or LiveAppData - just means doc type changes automatically regenerate the model classes into the app data folder - just AppData means you have to manually press the 'generate models' button in the developer section of Umbraco)
Anyway, in this mode to use the models in your Visual Studio solution and get intellisense etc, you need to 'show all files on disk' then you'll see the generated files from within visual studio, but greyed out, then right click them, include in project and rebuild...
and your ysod should go away!
regards
Marc
Hello Gareth Barnes,
I Hope you are using default Model Builder in you application which is PureLive. Just Double the check the Builder Builder Configuration in the webConfig File.
Also Try Below Steps.
Thanks,
Shekhar
Hi,
Thank you both for your responses. Unfortunately no matter what I tried I couldn't get Visual Studio to launch the site (the error happens at compile time so there was no opportunity to do anything through the front end of the CMS). I started again this morning in a new folder with newly extracted files from the zip file and having set the ModelsMode to AppData I followed the tutorial to create a document type and then pressed the Generate Models button and can see a file called HomePage.generated.cs in the AppData | Models folder but once again I am still receiving the same error in Visual Studio when I stop execution and try to restart it even with the HomePage.generated.cs file included in the project.
I've now followed the instructions to start Visual Studio with a blank project and imported Umbraco from NuGet and have been able to create a new document type, stop the code execution and then restart it successfully so maybe it is a problem with opening the zip file in Visual Studio - I don't think for whatever reason it was going through a full build process.
Gareth
Hi Gareth ,
Have you include the Home.Generated.Cs class In you project ?? If not you have to include the Home.Generated.cs class from Visual Studio and rebuild the application. Check if the error still exists .
we can have zoom call if you needed.. Thanks
Thanks,
Shekhar
Hi,
Yes, HomePage.generated.cs was included in the project. I'm up and running now by using the NuGet package so am happy to proceed that way and will just ignore the zip file.
Thanks for your help though.
Gareth
is working on a reply...