Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Luke Hook 45 posts 175 karma points c-trib
    Jul 09, 2019 @ 22:03
    Luke Hook
    0

    Umbraco 8.0.1-8.1 upgrade breaks modes builder

    Hi,

    I have a local project running 8.0.1. The models builder is running in LiveMode. I followed the instructions when upgrading to 8.1 as I was aware there are some breaking changes. Upon upgrading ModelsBuilder displayed the following error, telling me models builder was missing some methods (not unexpected).

    Failed to build PureLive models. Method not found: 'Umbraco.Core.Models.PublishedContent.PublishedContentType Umbraco.Core.Models.PublishedContent.IPublishedContentTypeFactory.CreateContentType(Umbraco.Core.Models.IContentTypeComposition)'.

    The upgrade instructions contains the following advice.

    If you've got your generated models in your solution you will need to update them after upgrade: PublishedContentType will need to be replaced with IPublishedContentType. If you have a implementintation of the PropertyValueConverter class, you need to replaced all references to PublishedPropertyType with IPublishedPropertyType within that class. Only after you do that will your solution build again.

    Only, for some reason, none of my generated.cs files are there. I ONLY have a models.err file. The above information is not very concise. Umbraco is great because it's accessible for so many but I strongly recommend you provide clearer instructions for the more simple among us (like myself).

    Where do I need to replace the methods? Specifically? If I do not have generated models how can I solve this? Introducing breaking changes is fine as long as there are detailed instructions on how to work around them

  • Thomas 315 posts 602 karma points c-trib
    Jul 09, 2019 @ 22:46
    Thomas
    0

    Are you using the image processor ( umbraco slimsy) ?

    I got the same error until I removed

     <source sizes="auto" class="lazyload" srcset="@Url.GetSrcSetUrls(heroContent.Image, "tall")" />
    
  • Luke Hook 45 posts 175 karma points c-trib
    Jul 09, 2019 @ 22:57
    Luke Hook
    0

    Unfortunately not. The project itself is pretty straight forward. Nothing outside the basics.

    I have retrieved the generated model files and made the recommended changes within them but unfortunately the error persists. I also can't roll Umbraco back now so I'm pretty stuck with this.

  • Shannon Deminick 1524 posts 5270 karma points MVP 2x
    Jul 10, 2019 @ 07:12
    Shannon Deminick
    1

    Many packages will need to be rebuilt against 8.1 and then released to support 8.1. Until then some packages will simply not work with 8.1.

    As for this particular error it sounds like the Umbraco.ModelsBuilder.dll hasn't been updated to the correct version.

    I'm unsure how you upgraded your site but please check what you models builder dll version is? It should be 8.1 ... see image:

    enter image description here

    Also, do you have a full stack trace for this error? It will be in your logs.

  • Dave de Moel 122 posts 574 karma points c-trib
    Jul 10, 2019 @ 07:56
    Dave de Moel
    0

    If you use PureLive the models are placed in the App_Data folder. Did you remove these? As the types the modelbuilder can't find are in those models.

    enter image description here

  • Luke Hook 45 posts 175 karma points c-trib
    Jul 10, 2019 @ 08:31
    Luke Hook
    0

    Hi both,

    If you use PureLive the models are placed in the App_Data folder. Did you remove these? As the types the modelbuilder can't find are in those models.

    Good question Dave, initially they were there. I built the project and they were gone (replaced with models.err, not sure how that happens). I recovered them and made the necessary changes as instructed in the upgrade instructions.

    As for this particular error it sounds like the Umbraco.ModelsBuilder.dll hasn't been updated to the correct version.

    Thanks for this Shannon, I upgraded initially via nuget update. When that wasn't working I downloaded the zip and manually dropped the bin and Umbraco folders in for good measure (my typical process of throw many things at it many times). You're right though, even with dropping the bin folder over I can see the dll was still 8.0.4 which is weird. I've extracted the right dll (and checked all others) and it is now 8.1 but I'm still seeing errors.

    I'll grab the stacktrace. For clarity, in the generated model builder class files (all.generated.cs and models.generated.cs) and I supposed to be changing PublishedPropertyType > IPublishedPropertyType AND PublishedContentType > IPublishedContentType?

  • Luke Hook 45 posts 175 karma points c-trib
    Jul 10, 2019 @ 08:41
    Luke Hook
    0

    Ok, I think I've discovered my problem. It must be a reference somewhere to the older 8.0.4 Models Builder dll. I dropped the 8.1.0 dll in and ran the project with no errors. I think my issue before was I had been cleaning the solution (like a noob) and then rebuilding. Not quite sure why this would happen.

    Worth noting as well that every time I rebuild by solution. Umbraco.ModelsBuilder reverts to 8.0.4 so this isn't entirely fixed. Any ideas what i'm missing?

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Jul 10, 2019 @ 10:03
    Sebastiaan Janssen
    0

    If you have multiple projects in your visual studio solution, make sure to NuGet update all projects to have the latest UmbracoCms.Web and UmbracoCms.Core otherwise old dlls might be copied in on each build.

  • Luke Hook 45 posts 175 karma points c-trib
    Jul 10, 2019 @ 14:04
    Luke Hook
    0

    Hi Sebastiaan,

    I have a small Business layer project and a test proj but neither of which use Umbraco at all.

    enter image description here

    So at Solution level all relevant projects are updated. I just can't see where the reference is for ModelsBuilder 8.0.4. Whenever I rebuild the project that dll, and that dll alone, reverts to 8.0.4. The way i can solve is to paste back in the 8.1.0 DLL.

    Might be worth noting that there were other issues when I upgraded using Nuget. The backoffice buttons all had placeholder text in [button_save] for example.

    I had to manually download and paste over Umbraco and Bin folders to resolve this. Have I missed something obvious here?

  • Dave de Moel 122 posts 574 karma points c-trib
    Jul 10, 2019 @ 14:06
    Dave de Moel
    102

    Best thing to do in that situation I guess is to the bin and obj folder, remove the references/packages for the modelsbuilder and reinstall them via nuget.

    Might be a caching error in Visual Studio that pops up ones in a while

  • Luke Hook 45 posts 175 karma points c-trib
    Jul 10, 2019 @ 14:27
    Luke Hook
    0

    Dave thank you so much!

    That's exactly what it was, definitely should have thought about that. I noticed that, for whatever reason. The models builder package wasn't in my nuget so never got updated with the rest of Umbraco. Weird.

    That definitely solved the issue!

    '#H5YR'

  • Shannon Deminick 1524 posts 5270 karma points MVP 2x
    Jul 15, 2019 @ 03:45
    Shannon Deminick
    0

    Glad the issue is resolved however we need to update our upgrade notes since you shouldn't need to do anything with your generated model files, etc... when running Pure Live. The docs should state this, that updating model files is only necessary when not running Pure Live.

Please Sign in or register to post replies

Write your reply to:

Draft