We are using umbraco with a extensions project so we have a solutionfile with 2 projects.
I now copy the models from the App_Data/Models folder to the models/generated folder in the extensions project. This method is prone to errors and its manual stuf I can do without.
What is the best way to work with the extensions project? I cant find any documentation about this.
what we do is set the ModelsBuilder to Dll and then reference our second project to this dll which is called Umbraco.Web.PublishedContentModels and is located in the bin folder of your main project.
Several configurations are possible, and some may fit better for your purposes than others.
Which one fits best, is hard to tell.
I have tried several configurations.
So far, the solution that works quite flexible for me is one that uses the Umbraco.ModelsBuilder.Api, having ModelsMode set to Nothing, and where the models are generated directly into my class library (via Run custom tool).
This way I can decide for myself when in the development process, I want to generate new/updated classes and in which class libraries.
Working with modelsbuilder and extensions project
Hi all,
We are using umbraco with a extensions project so we have a solutionfile with 2 projects.
I now copy the models from the App_Data/Models folder to the models/generated folder in the extensions project. This method is prone to errors and its manual stuf I can do without.
What is the best way to work with the extensions project? I cant find any documentation about this.
Thanks Frans
You could write your models outside of your website into another project. See
AcceptUnsafeModelsDirectory
in the documentation.Hi Frans,
what we do is set the ModelsBuilder to Dll and then reference our second project to this dll which is called
Umbraco.Web.PublishedContentModels
and is located in the bin folder of your main project.Hope this helps!
/Michaël
Several configurations are possible, and some may fit better for your purposes than others.
Which one fits best, is hard to tell.
I have tried several configurations. So far, the solution that works quite flexible for me is one that uses the Umbraco.ModelsBuilder.Api, having ModelsMode set to Nothing, and where the models are generated directly into my class library (via Run custom tool).
This way I can decide for myself when in the development process, I want to generate new/updated classes and in which class libraries.
Thanks for the answers all!!
@Micha: Are you using this custom tools as a base?
https://github.com/zpqrtbnk/Zbu.ModelsBuilder/tree/master/Umbraco.ModelsBuilder.CustomTool
Yes, that's the CustomTool extension I am using.
Thanks! This sounds like a solution that fits our case
is working on a reply...