I have a project with the following settings:
"ModelsBuilder": {
"ModelsMode": "SourceCodeManual",
"ModelsDirectory": "~/../MyProject.Models",
"ModelsNamespace": "MyProject.Models",
"AcceptUnsafeModelsDirectory": true,
"FlagOutOfDateModels": true
}
This works locally: I generate the models, see them added to my class library, build successfully, and the application runs without issues.
However, when deploying to staging, I encounter an ambiguous reference error. It seems to reference Umbraco.Cms.Web.Common.PublishedModels instead of MyProject.Models. It’s almost as if the appSettings.Staging configuration is being ignored.
I’ve added the same settings to the base appSettings. I suspect the the staging configuration is ignored; as the back office prompts for connection details during the first boot and then adds the connection string to the default appSettings file.
Comparing with another site that has the same settings/setup and generates .cs files in the MyProject.Models folder, my newly deployed site only generates a .dll.
I can’t find any differences in the build/publish profiles, Program.cs, appSettings, etc.
Is there something obvious I’m missing? Why would it work locally but fail on the server?