I have created a new starter project and then cloned from the Live cloud version of Umbraco. When I clone and then run the project locally I get the following error. I believe it relates to the models not being generated:
The type or namespace name 'Home' does not exist in the namespace 'Umbraco.Cms.Web.Common.PublishedModels' (are you missing an assembly reference?)
+
public class Views_home : Umbraco.Cms.Web.Common.Views.UmbracoViewPage
I have tried changing the configuration for the models
Are there models in your ~/models-builder/generated folder ?
If not, then you need to go in the backoffice and run the modelsbuilder on the Settings page, that should generate your models in the specified folder for you.
No the folder was empty and the option to generate the models in the settings page was disabled.
I have managed to fix the issue. I cloned the solution from Git again but did it to the 'Documents' area rather and opened Visual Studio as admin. Now the models are being generated. So not sure if it was a permissions issue.
Umbraco 9 models not being generated
I have created a new starter project and then cloned from the Live cloud version of Umbraco. When I clone and then run the project locally I get the following error. I believe it relates to the models not being generated:
The type or namespace name 'Home' does not exist in the namespace 'Umbraco.Cms.Web.Common.PublishedModels' (are you missing an assembly reference?) + public class Views_home : Umbraco.Cms.Web.Common.Views.UmbracoViewPage
I have tried changing the configuration for the models
"ModelsBuilder": { "ModelsDirectory": "~/models-builder/generated", "Enable": true, "ModelsMode": "SourceCodeAuto", "AcceptUnsafeModelsDirectory": true },
Are there models in your ~/models-builder/generated folder ?
If not, then you need to go in the backoffice and run the modelsbuilder on the Settings page, that should generate your models in the specified folder for you.
No the folder was empty and the option to generate the models in the settings page was disabled.
I have managed to fix the issue. I cloned the solution from Git again but did it to the 'Documents' area rather and opened Visual Studio as admin. Now the models are being generated. So not sure if it was a permissions issue.
is working on a reply...