Intellisense on models in Visual studio
To get Intellisense on your umbraco models from modelsbuilder we have two recommended ways of achiving this.

Option 1

Install the full ModelsBuilder (https://github.com/zpqrtbnk/Zbu.ModelsBuilder) nuget package and change the ModelsMode to Dll and then build your models in the Umbraco backoffice. This will generate a Dll that will give you intellisense.

Option 2

Create a new project in Visual Studio that will contain your models and make it build into your web project. Change your ModelsMode to AppData and add these two settings to your web.config:
1
<add key="Umbraco.ModelsBuilder.AcceptUnsafeModelsDirectory" value="true" />
2
<add key="Umbraco.ModelsBuilder.ModelsDirectory" value="~/../Project.Models/Models" />
Copied!
Where the Project.Models is the name of your models project. This will generate your models into this directory and will on build generate a dll with your models.

For more information on Models in Umbraco you can check out Umbracos documentation at https://our.umbraco.com/documentation/reference/templating/modelsbuilder
Last modified 10mo ago
Copy link