Compilation errors when using SourceCodeAuto model...
# help-with-umbraco
a
Hoping I can get a bit of help with this ongoing issue. We generally run our sites with ModelBuilder set to SourceCodeAuto to provide strong typing and intellisense in views, but when making changes to doc types we often encounter compliation errors. No problem in dev, stop debugging, rebuild, job's a good-un. The issue comes when publishing changes made in dev to staging or production. Even using uSync and forcing a re-gen in the models builder this error will still come up until the site has been rebooted (running in IIS, app pool recycle and restart web site) and sometimes requires mutliple reboots. Is there a cleaner/alternative way to do this without having to reboot the site every time and without resorting to Model.Value?
u
Hi Alex, from the Docs It is recommended to generate models in your development environment only and change the ModelsMode to Nothing for your staging and production environments. You then build the models locally and deploy the resulting dll along with usync to update the doctypes HTH, tom https://docs.umbraco.com/umbraco-cms/reference/templating/modelsbuilder/configuration
m
Also take a look at runtime modes... Where as mentioned abovee it's suggested bestpractice to set different modelsbuilder modes for your different tiers.. eg
None
when in production. As well as minification, razor view compilation, locking down template editing etc.. https://docs.umbraco.com/umbraco-cms/fundamentals/setup/server-setup/runtime-modes
a
Cheers, guys. This helps a lot. Sounds like I should have RTFM!
p
@User May I suggest “folks” instead of "guys"? We use gender inclusive language in this Discord 😀