NullReferenceException or EntryPointNotFoundException thrown with IL generated content models with CMS 11.19

Found in

EPiServer.CMS.Core 11.19.0

Fixed in

EPiServer.CMS.Core 11.20.0

Created

Sep 29, 2020

Updated

Oct 08, 2020

Area

CMS Core

State

Closed, Fixed and tested


Description

Client has upgraded CMS from 11.17.0 -> 11.19.0. They have never deployed with 11.18.x.

Site starts up fine and they can login but when the browse any page they receive the following exception. (Scroll below exception to see what fixes it)

[NullReferenceException: Object reference not set to an instance of an object.]
x.y.z.Catalog.SKUContent_DynamicProxy.MakeReadOnly() +1184
EPiServer.Construction.Internal.ContentFactory.CreateContent(ContentType contentType, BuildingContext buildingContext) +351
EPiServer.Commerce.Catalog.Provider.Construction.Internal.CatalogContentFactory.CreateContent(ContentType contentType, BuildingContext buildingContext) +182
EPiServer.Commerce.Catalog.Provider.Construction.MetaClassContentFactory.Create(Type type, String language, Nullable`1 catalogId) +315
EPiServer.Commerce.Catalog.Provider.Construction.MetaClassContentFactory.Create(String baseEntryType, Int32 metaClassId, String language, Nullable`1 catalogId) +272
EPiServer.Commerce.Catalog.Provider.Construction.EntryBuilder.GetCatalogContent(String entryType, Int32 metaClassId, String language, Int32 catalogId) +68
EPiServer.Commerce.Catalog.Provider.Construction.<>c__DisplayClass8_0.<ConstructEntries>b__0(CatalogEntryRow x) +96
System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +234
System.Linq.WhereEnumerableIterator`1.MoveNext() +245
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +452
System.Linq.Enumerable.ToList(IEnumerable`1 source) +72
EPiServer.Commerce.Catalog.Provider.Construction.EntryBuilder.ConstructEntries(CatalogEntryDto entryDto, IDictionary`2 versionsForUnpublishedContent, IDictionary`2 primaryNodeRelations, String language) +359
EPiServer.Commerce.Catalog.Provider.Construction.EntryBuilder.Create(IList`1 contentLinks, String language) +879
EPiServer.Commerce.Catalog.Provider.CatalogContentLoader.ConstructContent(IList`1 contentLinks, Func`3 createContentFunc) +538
EPiServer.Commerce.Catalog.Provider.CatalogContentLoader.LoadSpecificContentInstances(IList`1 contentLinks, String language) +331
EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.BatchLoad(IList`1 contentLinks, Func`2 dbLoader) +246
EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.LoadContents(IList`1 contentReferences, ILanguageSelector selector) +779
EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.LoadContent(ContentReference contentLink, ILanguageSelector languageSelector) +224
EPiServer.Core.<>c__DisplayClass121_0.<LoadContentFromCacheOrRepository>b__0() +34
EPiServer.Framework.Cache.ObjectInstanceCacheExtensions.ReadThroughWithWait(IObjectInstanceCache cache, String cacheKey, Func`1 readValue, Func`2 evictionPolicy) +1035
EPiServer.Core.Internal.ContentInstanceCache.ReadThrough(ContentReference contentLink, String selectedLanguage, Func`1 readValue) +107
EPiServer.Core.ContentProvider.LoadContentFromCacheOrRepository(ContentReference contentreference, ILanguageSelector selector) +617
EPiServer.Core.Internal.ProviderPipelineImplementation.GetItem(ContentProvider provider, ContentReference contentLink, LoaderOptions loaderOptions) +327
EPiServer.Core.Internal.DefaultContentLoader.TryGet(ContentReference contentLink, LoaderOptions loaderOptions, T& content) +577
EPiServer.Core.Html.StringParsing.ContentFragment.GetContent(Boolean enableMasterLanguageFallback) +203
EPiServer.Core.Html.StringParsing.ContentFragment.GetSecurityDescriptor() +33
EPiServer.Core.ContentAreaItem..ctor(ContentFragment fragment) +55

 

But adding the following app setting fixes it

<add key="episerver:setoption:EPiServer.Core.ContentOptions.ProxyType,EPiServer" value="Castle" />