I have upgraded to Umbraco 8.1.1 for the security fix, and now site fails to build with the following error.
The error is related to the class library which contains the ModelsBuider
Severity Code Description Project File Line Suppression State
Error CS0266 Cannot implicitly convert type
'Umbraco.Core.Models.PublishedContent.IPublishedContentType' to
'Umbraco.Core.Models.PublishedContent.PublishedContentType'. An
explicit conversion exists (are you missing a
cast?) *\Web.ContentHelper\UmbracoModelBuilder\Blog.generated.cs 34 Active
Code:
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.0.4")]
public new const string ModelTypeAlias = "contact";
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.0.4")]
public new const PublishedItemType ModelItemType = PublishedItemType.Content;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.0.4")]
public new static PublishedContentType GetModelContentType()
=> PublishedModelUtility.GetModelContentType(ModelItemType, ModelTypeAlias);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.0.4")]
public static PublishedPropertyType GetModelPropertyType<TValue>(Expression<Func<Contact, TValue>> selector)
=> PublishedModelUtility.GetModelPropertyType(GetModelContentType(), selector);
#pragma warning restore 0109
May be off track with this suggestion, but have you tried a "Clean Solution" first ? Primarily trying to delete any previously compiled model records and allow the build to recreate with a clean slate.
Errors thrown after upgrade to 8.1.1
I have upgraded to Umbraco 8.1.1 for the security fix, and now site fails to build with the following error.
The error is related to the class library which contains the ModelsBuider
Code:
Hi George
May be off track with this suggestion, but have you tried a "Clean Solution" first ? Primarily trying to delete any previously compiled model records and allow the build to recreate with a clean slate.
Cheers
Nigel
Hi Nigel
Done that and it did not work, I have rolled back to the previous state for now and will use the manual fix.
Regards George
If anyone comes across the same issue, this is how I had to fix the problem.
In previous versions 8.0.2, the modelbuilder created the models with the following code snippet
When upgrading to 8.1.1, the above remained the same, thus preventing the solution from building.
To fix the problem, I had to manually change PublishedContentType and PublishedPropertyType to IPublishedContentType and IPublishedPropertyType
Once that was done, I was able to rebuild the ModelsBuilder and thus fix the problem.
Fortunately for me, I only had 20 generated files so it did not take to long.
is working on a reply...