Hi Everyone, not sure of this is still an issue for others but I found my problem resolution was a little different to other posted. I had made a mistake in my inherited Document Types which caused my issue. I found the root cause by going to the folder [MyProject]App_Data > Models > and inside there was a file called models.err. This file gave me this error info:
Failed to build PureLive models.
Cannot generate model for type 'hero' because it is an element type, but it is composed of 'contentBase' which is not.
at Umbraco.ModelsBuilder.Building.Builder.Prepare() in D:\d\Zbu ModelsBuilder\src\Umbraco.ModelsBuilder\Building\Builder.cs:line 244
at Umbraco.ModelsBuilder.Umbraco.PureLiveModelFactory.GenerateModelsCode(IDictionary`2 ourFiles, IList`1 typeModels) in D:\d\Zbu ModelsBuilder\src\Umbraco.ModelsBuilder\Umbraco\PureLiveModelFactory.cs:line 567
at Umbraco.ModelsBuilder.Umbraco.PureLiveModelFactory.GetModelsAssembly(Boolean forceRebuild) in D:\d\Zbu ModelsBuilder\src\Umbraco.ModelsBuilder\Umbraco\PureLiveModelFactory.cs:line 458
at Umbraco.ModelsBuilder.Umbraco.PureLiveModelFactory.EnsureModels() in D:\d\Zbu ModelsBuilder\src\Umbraco.ModelsBuilder\Umbraco\PureLiveModelFactory.cs:line 283
I simply fixed my Document Types and all good. I raise this as most other solutions were DLL or Nuget package based and this problem was much simpler. My errors and symptoms were identical but resolution completely different. I hope this helps someone who may be seeing something similar.
Nested content "Object reference not set to an instance of an object."
Hi! I've started to get this error on a fresh installation on Umbraco 8.3:
Stack trace:
[NullReferenceException: Object reference not set to an instance of an object.] Umbraco.ModelsBuilder.Umbraco.PureLiveModelFactory.CreateModelList(String alias) +57 Umbraco.Web.PropertyEditors.ValueConverters.NestedContentManyValueConverter.ConvertIntermediateToObject(IPublishedElement owner, IPublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, Object inter, Boolean preview) +222 Umbraco.Core.Models.PublishedContent.PublishedPropertyType.ConvertInterToObject(IPublishedElement owner, PropertyCacheLevel referenceCacheLevel, Object inter, Boolean preview) +57 Umbraco.Web.PublishedCache.NuCache.Property.GetValue(String culture, String segment) +197 Umbraco.Web.PublishedPropertyExtension.Value(IPublishedProperty property, String culture, String segment, Fallback fallback, T defaultValue) +71 Umbraco.Web.PublishedContentExtensions.Value(IPublishedContent content, String alias, String culture, String segment, Fallback fallback, T defaultValue) +117 ASP.PageViewsindholdcshtml.Execute() in C:\laragon\www\UmbracoTemplate.Core\UmbracoTemplate.Web\Views\indhold.cshtml:13 System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198 System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +105 System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78 System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +235 System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107 Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +98 System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +290 System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +56 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList1 filters, ActionResult actionResult) +52 System.Web.Mvc.Async.<>c__DisplayClass3_6.<BeginInvokeAction>b__4() +198 System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult) +100 System.Web.Mvc.Async.WrappedAsyncResult
1.CallEndDelegate(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27 System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +11 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) +29 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +45 System.Web.Mvc.<>c.<BeginExecute>b__151_2(IAsyncResult asyncResult, Controller controller) +13 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) +22 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10 System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +28 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) +29 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +576 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +132 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +163I'm trying to get a Nested content out as an IEnumerable
Can anyone help with this? If you need more info please tell me
Thanks in advance!
In addition Model.Value("grid") also returns null - seems like there's a bug with retrieving the data?
Hi, I have the same issue. Did you find any solution for it Christian?
hi Christian here is my fix
Install Umbraco.ModelsBuilder from Nuget In web.config you should have next values for Umbraco.ModelsBuilder
Hi Everyone, not sure of this is still an issue for others but I found my problem resolution was a little different to other posted. I had made a mistake in my inherited Document Types which caused my issue. I found the root cause by going to the folder [MyProject]App_Data > Models > and inside there was a file called models.err. This file gave me this error info:
I simply fixed my Document Types and all good. I raise this as most other solutions were DLL or Nuget package based and this problem was much simpler. My errors and symptoms were identical but resolution completely different. I hope this helps someone who may be seeing something similar.
Thanks,
Thank @Danny, I have the same problem like you. I remove composition from base document type and it works normally.
Thanks, Phong. Spent ages trying to fix this and by removing the composition, it worked for me as well.
is working on a reply...