[SOLVED] 500:The type 'Home' exists in both 'ModelsGeneratedAssembly' and 'Umbraco.BlogAttempt.01'
j
Hi! I've just attempted to deploy my project 'Umbraco.BlogAttempt.01' to Azure App Service, and the front-end pages are giving me 500 messages. The log generated when I request a page reports:
Copy code
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.CompilationFailedException: One or more compilation failures occurred:\r\ngipivcuq.woh(75,90): error CS0433: The type 'Home' exists in both 'ModelsGeneratedAssembly, Version=0.0.0.1, Culture=neutral, PublicKeyToken=null' and 'Umbraco.BlogAttempt.01, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'\r\nC:\\home\\site\\wwwroot\\Views\\home.cshtml(10,89): error CS1503: Argument 1: cannot convert from 'method group' to 'string'\r\n   at Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.RuntimeView
and it continues. Any advice on what's happened, or, more importantly, what I can do have this not happen? TIA! #devops
m
I assume your using SourceCode for models builder locally set using appsettings.development.json The default is InMemoryAuto so setting it to Nothing will make it use your models and not generate cs files
j
Ah ok it's a ModelsBuilder thing. Nice. appsettings.Deployment.json:
"ModelsBuilder": { "ModelsMode": "SourceCodeManual" }
So, into appsettings.Production.json (or just appsettings.json), I should put:
"ModelsBuilder": { "ModelsMode": "Nothing" }
? Also, thank you for the utterly immediate response, #h5yr indeed
a
Correct!
j
You are all splendid, thank you. I will implement and get back to you.
All works - thank you so much!
a
Awesome!
4 Views