London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

EPiServer.Core.TypeMismatchException when adding new PropertyList

Vote:
 

We are running EPiServer CMS 12.32.3. We have serveral different PropertyLists on our site and have been using them for years. 

But now I have run into an issue where I get a TypeMismatchException that craches the site when I start it the first time after adding a new PropertyList with a new PropertyDefinitionTypePlugIn. If I restart the site after the crash everything works as expected and I can use the PropertyList as intended. Has anyone else run into this issue? Does anyone know how I can fix it?

Below is an example of the error I get on the first startup after adding a brand new PropertyList.

2025-03-20 10:32:57.671 [Error] Hosting failed to start
EPiServer.Framework.Initialization.InitializationException: Initialize action failed for Initialize on class EPiServer.Initialization.Internal.ModelSyncInitialization, EPiServer, Version=12.22.3.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7
 ---> EPiServer.Core.TypeMismatchException: Type 'System.Collections.Generic.IList`1[[CMS.Models.Blocks.Utbildning.StudieplanversionData, CMS.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' could not be mapped to a PropertyDefinitionType
   at EPiServer.DataAbstraction.RuntimeModel.Internal.PropertyDefinitionSynchronizer.ResolveType(PropertyDefinitionModel model)
   at EPiServer.DataAbstraction.RuntimeModel.Internal.PropertyDefinitionSynchronizer.CreatePropertyDefinition(PropertyDefinitionModel model, Int32 contentTypeID)
   at EPiServer.DataAbstraction.RuntimeModel.Internal.ContentTypeModelRegister.CommitProperties(Boolean deleteUnusedTypes)
   at EPiServer.DataAbstraction.RuntimeModel.Internal.ContentTypeModelScanner.Sync(Boolean forceCommit)
   at EPiServer.Initialization.Internal.ModelSyncInitialization.Initialize(InitializationEngine context)
   at EPiServer.Framework.Initialization.Internal.ModuleNode.<>c__DisplayClass4_0.<Initialize>b__0()
   at EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key)
   at EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context)
   at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()
   --- End of inner exception stack trace ---
   at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()
   at EPiServer.Framework.Initialization.InitializationEngine.ExecuteTransition(Boolean continueTransitions)
   at EPiServer.Framework.Initialization.InitializationEngine.Initialize()
   at EPiServer.Hosting.Internal.EPiServerFrameworkHost.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
   at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)

 

 

#337448
Mar 21, 2025 17:45
Vote:
 

Hello ThereseM

Some time ago, Optimizely released the Official List property. You can read more about it here:

https://world.optimizely.com/blogs/bartosz-sekula/dates/2023/1/official-list-property-support/

If the issue occurs only with new properties, it might be worth switching to this new approach—it could help resolve your problems.

#337455
Mar 22, 2025 18:21
Vote:
 

I would recommend using IList<yourtype> and yourtype inheriting from BlockData. 
You would have to write a scheduled job for migration of the content too. 

 

#337690
Apr 02, 2025 16:58
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.