I am trying to get the Umbraco Model builder to generate my models and put them in the app_code directory (I'm using Umbraco cloud) and I want to have intlisense in my views and custom code.
When I go in to umbraco back office and generate the models, I get all the models in my App_code folder as expected, but it also genrates a Umbraco.Web.PublishedContentModels.dll file with all the models and puts it in the bin folder.
Why is Umbraco generating two versions of the models, how do I stop it from doing so?
So per your configuration you are using Dll Models.
With Dll models, models are generated in the ~/App_Data/Models directory, then compiled into a Dll that is copied into ~/bin, thus restarting the application. Models must be generated explicitly from the dashboard or the content type editor.
It is doing what you have configured :)
On umbraco cloud, C# files aren't compiled, so you need to make sure they are build before publishing. The "Dll" mode does this, but it needs the files in order to compile them - thus you get cs files+dll. If you use mode "LiveAppData", it only generates the files, but then you have to compile them yourself.
Normally you don't need to change settings on umbraco cloud projects. What are you trying to benefit from using another setup?
I went through the documentation and I have read about the different modes, and after reading about each one I wanted to use either DLL or LiveDLL mode.
I understand that in DLL mode I need to click Generate Models and with LiveDLL the changes happen when you make a change to the document types.
I like the generation of each document type individually and because I am using cloud I am setting the output directory to /app_code so I can get full intelisense inside my views and in custom code.
The issue is every-time I generate the models, it works. I get a class genrated for each document type in app_code, but I also get Umbraco.Web.PublishedContentModels.dll in the bin directory resulting in:
"More that one type want to be a model for content type" message. Then I have to delete that DLL then everything works.
What I want to know is why is Umbraco generating the DLLs in two different ways, I only want the DLLs generated in app_code.
Umbraco Model builder - In the Cloud
Hi guys,
I am trying to get the Umbraco Model builder to generate my models and put them in the app_code directory (I'm using Umbraco cloud) and I want to have intlisense in my views and custom code.
These are my settings
When I go in to umbraco back office and generate the models, I get all the models in my App_code folder as expected, but it also genrates a Umbraco.Web.PublishedContentModels.dll file with all the models and puts it in the bin folder.
Why is Umbraco generating two versions of the models, how do I stop it from doing so?
https://our.umbraco.org/Documentation/reference/templating/Modelsbuilder/Builder-Modes
So per your configuration you are using Dll Models.
It is doing what you have configured :)
On umbraco cloud, C# files aren't compiled, so you need to make sure they are build before publishing. The "Dll" mode does this, but it needs the files in order to compile them - thus you get cs files+dll. If you use mode "LiveAppData", it only generates the files, but then you have to compile them yourself.
Normally you don't need to change settings on umbraco cloud projects. What are you trying to benefit from using another setup?
I went through the documentation and I have read about the different modes, and after reading about each one I wanted to use either DLL or LiveDLL mode.
I understand that in DLL mode I need to click Generate Models and with LiveDLL the changes happen when you make a change to the document types.
I like the generation of each document type individually and because I am using cloud I am setting the output directory to /app_code so I can get full intelisense inside my views and in custom code.
The issue is every-time I generate the models, it works. I get a class genrated for each document type in app_code, but I also get Umbraco.Web.PublishedContentModels.dll in the bin directory resulting in:
"More that one type want to be a model for content type" message. Then I have to delete that DLL then everything works.
What I want to know is why is Umbraco generating the DLLs in two different ways, I only want the DLLs generated in app_code.
In the end I just went with these two settings:
So now there is no out put in to the app_code folder and I just have the Umbraco.Web.PublishedContentModels.dll in the bin directory.
But it would be nice to know how to get it to work properly the other way.
is working on a reply...