Since upgrading from 9.3.1 to 9.4.1 our modelsbuilder has stopped working. When we make a change in the settings tab it doesn't display the 'Out-of-date' flag any longer. It even says that 'Tracking of out-of-date models is not enabled.', even though our 'ModelsBuilder' section in the appsettings.json configuration is as follows:
I also suspect this error may be causing other weird problems such as some generated models not being populated with data correctly. An example of this is a 'Cta' generated model that has a 'UrlPicker' property that for some reason is always null, even though we've set the link in the content tree.
Would love to hear from somebody who's experienced this or knows how to fix it.
Perhaps a helpful starting point would be to add an additional key-value pair to your appsettings.json for 'ModelsBuilder.DebugLevel', with an int value greater than zero to enable detailed logging on the ModelsBuilder. Maybe that will shed a light on what's going wrong with the ModelsBuilder!
If nothing shows up, we'll have to continue looking for other solutions to found out what's going wrong!
Thanks for the quick response. I tried adding the ModelsBuilder.DebugLevel with 1 as the value to the appsettings. Do you know where the supposed logging/debugging will be shown, I can't seem to find any logging happening?
In the CMS --> Settings --> Models Builder tab I'm seeing this:
Models Builder
Version: 9.4.3+192eb2699ba4131addbb08236f60eb031707f751
ModelsBuilder is enabled, with the following configuration:
The models mode is 'SourceCodeManual'. Strongly typed models are generated on demand. Recompilation is necessary and models are available to all CSharp code.
Models namespace is MyProject.Models.PublishedContent.
Tracking of out-of-date models is not enabled.
I have not noticed any problems with the content of the generated models (so far), but the interface clearly doesn't represent my configuration properly.
I looked for logging in the Log Viewer but there's nothing there related to models builder.
Has there been any movement on this issue? I'm seeing the same issue on the latest version of Umbraco (9.5.1) and have been seeing it for several versions now.
Version: 9.5.1+406576ddfa7f3577d959a32ec2296bd9f730786e
ModelsBuilder is enabled, with the following configuration:
The models mode is 'SourceCodeManual'. Strongly typed models are generated on demand. Recompilation is necessary and models are available to all CSharp code.
Models namespace is Umbraco.Cms.Web.Common.PublishedModels.
Tracking of out-of-date models is not enabled.
We are using uSync which I know flags changes as well to models. Could it be possible that could be involved here? Is anyone else having this issue also utilizing uSync?
Have encountered this problem myself, in that ood.flag is not being created when in SourceCodeManual mode.
It was mentioned in a meetup tonight (https://www.meetup.com/umbracalong/) and a pull request has been raised as a potential fix for the problem... Suggest you follow: https://github.com/umbraco/Umbraco-CMS/pull/12548
Hi I'm also getting an error. It's driving me crazy as I can't figure out why this is happening. I'm using Umbraco version 11.1.0
Models Builder
Version: 11.1.0+bad9148
ModelsBuilder is enabled, with the following configuration:
The models mode is 'SourceCodeAuto'. Strong typed models are generated on demand and anytime schema changes (i.e. Content Type) are made. Recompilation is necessary and models are available to all CSharp code.
Models namespace is Clo.ModelsGenerated.
Tracking of out-of-date models is not enabled.
Generate models
Last generation failed with the following error:
Failed to build models.
Object reference not set to an instance of an object.
at Umbraco.Cms.Core.Models.PublishedContent.ModelType.MapToName(Type type, Dictionary`2 map, Boolean dictionaryIsInvariant)
at Umbraco.Cms.Core.Models.PublishedContent.ModelType.MapToName(Type type, Dictionary`2 map)
at Umbraco.Cms.Infrastructure.ModelsBuilder.Building.TypeModel.MapModelTypes(IList`1 typeModels, String ns)
at Umbraco.Cms.Infrastructure.ModelsBuilder.Building.Builder.Prepare()
at Umbraco.Cms.Infrastructure.ModelsBuilder.Building.Builder..ctor(ModelsBuilderSettings config, IList`1 typeModels)
at Umbraco.Cms.Infrastructure.ModelsBuilder.Building.TextBuilder..ctor(ModelsBuilderSettings config, IList`1 typeModels)
at Umbraco.Cms.Infrastructure.ModelsBuilder.Building.ModelsGenerator.GenerateModels()
at Umbraco.Cms.Web.BackOffice.ModelsBuilder.ModelsBuilderDashboardController.BuildModels()
I can answer my own question: Services for the Umbraco front-end website was needed. So had to add: .AddWebsite() in Startup. Thought the AddBackOffice should add everything needed here.
Modelsbuilder stopped working
Since upgrading from 9.3.1 to 9.4.1 our modelsbuilder has stopped working. When we make a change in the settings tab it doesn't display the 'Out-of-date' flag any longer. It even says that 'Tracking of out-of-date models is not enabled.', even though our 'ModelsBuilder' section in the appsettings.json configuration is as follows:
I also suspect this error may be causing other weird problems such as some generated models not being populated with data correctly. An example of this is a 'Cta' generated model that has a 'UrlPicker' property that for some reason is always null, even though we've set the link in the content tree.
Would love to hear from somebody who's experienced this or knows how to fix it.
Hi Frederik,
Perhaps a helpful starting point would be to add an additional key-value pair to your appsettings.json for 'ModelsBuilder.DebugLevel', with an int value greater than zero to enable detailed logging on the ModelsBuilder. Maybe that will shed a light on what's going wrong with the ModelsBuilder!
If nothing shows up, we'll have to continue looking for other solutions to found out what's going wrong!
Kind regards,
Corné Hoskam
Hi Corné,
Thanks for the quick response. I tried adding the ModelsBuilder.DebugLevel with 1 as the value to the appsettings. Do you know where the supposed logging/debugging will be shown, I can't seem to find any logging happening?
I am experiencing this issue as well. I'm developing a site using Umbraco CMS v9.4.3 and my models builder configuration is:
In the CMS --> Settings --> Models Builder tab I'm seeing this:
I have not noticed any problems with the content of the generated models (so far), but the interface clearly doesn't represent my configuration properly.
I looked for logging in the Log Viewer but there's nothing there related to models builder.
Has there been any movement on this issue? I'm seeing the same issue on the latest version of Umbraco (9.5.1) and have been seeing it for several versions now.
And here's the appsettings:
We are using uSync which I know flags changes as well to models. Could it be possible that could be involved here? Is anyone else having this issue also utilizing uSync?
Have encountered this problem myself, in that ood.flag is not being created when in SourceCodeManual mode.
It was mentioned in a meetup tonight (https://www.meetup.com/umbracalong/) and a pull request has been raised as a potential fix for the problem... Suggest you follow: https://github.com/umbraco/Umbraco-CMS/pull/12548
Hi I'm also getting an error. It's driving me crazy as I can't figure out why this is happening. I'm using Umbraco version 11.1.0
Models Builder Version: 11.1.0+bad9148
Generate models Last generation failed with the following error:
Here's my appsettings:
Here's what the logs say:
Hi, I´m also experiencing an error using ModelsBuilder on Umbraco 11.2.0.
My appsettings as follow:
In Umbraco the ModelsBuilder dashboard is empty and no error in log either.
But in browser developer console there´s an error in angular.js saying
I can answer my own question: Services for the Umbraco front-end website was needed. So had to add:
.AddWebsite()
in Startup. Thought theAddBackOffice
should add everything needed here.is working on a reply...