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
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.
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?
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?
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.
I have a small Business layer project and a test proj but neither of which use Umbraco at all.
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?
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
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.
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.
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).
The upgrade instructions contains the following advice.
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
Are you using the image processor ( umbraco slimsy) ?
I got the same error until I removed
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.
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:
Also, do you have a full stack trace for this error? It will be in your logs.
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.
Hi both,
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.
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?
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?
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.
Hi Sebastiaan,
I have a small Business layer project and a test proj but neither of which use Umbraco at all.
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?
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
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'
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.
is working on a reply...