umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.42k stars 2.67k forks source link

ModelsBuilder in AppData mode error when making change to doctype #9652

Closed giacomolanza closed 2 years ago

giacomolanza commented 3 years ago

An error occurs when making change to a doctype and regenerate models using Models Builder in AppData mode. The same issue was discussed and should have been fixed in #5671

Umbraco version

I am seeing this issue on Umbraco version: 8.9

Reproduction

Bug summary

When I make some changes to a doctype pressing the "Generate model" button and refresh the front end of the website I receive the following error:

Cannot bind source content type Umbraco.Web.PublishedModels.Destination to model type Umbraco.Web.PublishedModels.Destination.

I need to delete the /App_Data/TEMP folder and reload the site to make it works.

Specifics

This is my ModelsBuilder configuration:

<add key="Umbraco.ModelsBuilder.Enable" value="true" /> <add key="Umbraco.ModelsBuilder.ModelsMode" value="AppData" /> <add key="Umbraco.ModelsBuilder.ModelsDirectory" value="~/App_Code/Umbraco.Web.PublishedModels" />

Steps to reproduce

Just make some changes to a doctype and press "Generate models" on Models Builder dashboard.

Actual result

An error occurs. Here is a screenshot:

Image 2

nul800sebastiaan commented 3 years ago

That's annoying @giacomolanza - even more annoying is probably that I can not reproduce the problem 😞

I've updated my web.config with the 3 keys you provided, added a propery to a doctype, regenerated the models and the content on the types of pages that was updated is working just fine. Any additional steps?

9652

giacomolanza commented 3 years ago

@nul800sebastiaan as you can see from the recorded screen the steps to reproduce the issue are the same. Are there any info I can provide to allow you to reproduce the steps? Are there any other checks I can do?

Screen

giacomolanza commented 3 years ago

@nul800sebastiaan is there a temporary fix or something that I can do to force Umbraco 8 cache refresh when models are automatically regenerated? Thanks

nul800sebastiaan commented 3 years ago

@giacomolanza Afraid not.. if we can't reproduce we also can't make a fix for it, even temporary 😞

Only thing I can think of at the moment is to use a different modelsbuilder mode I'm afraid.

giacomolanza commented 3 years ago

@nul800sebastiaan thank you for your help. Since the Umbraco cache is not working in this case, do you think that installing a version that supports Dll ModelsMode is a good idea?

In this documentation page there is the section "Installing": https://our.umbraco.com/documentation/reference/templating/modelsbuilder/introduction that says "The Models Builder is by default embedded in Umbraco. If you need any complex features, you still need to add the full package. Check the official releases on the Models Builder GitHub repository for more details.". The link points to a GitHub project: https://github.com/modelsbuilder/ModelsBuilder.Original/releases

I'm trying to install this ModelsBuilder version but an error occurs: Image 3

prosperva commented 3 years ago

I have run into similar issues. What version of Umbraco are you using?

giacomolanza commented 3 years ago

@prosperva in the first comment of this thread you can find all my settings including the Umbraco versione that is 8.9 (I had the same error in v8.10).

umbrabot commented 2 years ago

Hiya @giacomolanza,

Just wanted to let you know that we noticed that this issue got a bit stale and might not be relevant any more.

We will close this issue for now but we're happy to open it up again if you think it's still relevant (for example: it's a feature request that's not yet implemented, or it's a bug that's not yet been fixed).

To open it this issue up again, you can write @umbrabot still relevant in a new comment as the first line. It would be super helpful for us if on the next line you could let us know why you think it's still relevant.

For example:

@umbrabot still relevant This bug can still be reproduced in version x.y.z

This will reopen the issue in the next few hours.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face: