The unofficial way to fix the issue is to run this SQL snippet in context of CMS database
UPDATE tblContentType
SET modelType = 'EPiServer.Core.CampaignFolder, EPiServer.Business.Commerce, Version=8.6.1.431, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'
WHERE [Name] like 'SysCampaignFolder'
Untested by me.
Hi Quan,
I had found the article that the snippet is from but was unsure whether it would be useful due to the older versions in play.
I've just ran it against the DB and it just returns the same error but with a different version number.
Could not create instance of content type "SysCampaignFolder" since it has an invalid .NET class associated: EPiServer.Core.CampaignFolder, EPiServer.Business.Commerce, Version=8.6.1.431, Culture=neutral, PublicKeyToken=8fe83dea738b45b7
Any other ideas? Has the SysCampaignFolder been phased out in the current packages or anything like that?
Hmm, now I look into it, it looks like the content type was removed and the root was registered automatically. So can you try to back up your databases and try to delete that content type?
Hi Quan,
I deleted the content type from the database however, it seems like that results in an error -
Value cannot be null. Parameter name: contentType Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: contentType Source Error: [No relevant source lines] Source File: c:\Users\james.johnson\AppData\Local\Temp\Temporary ASP.NET Files\vs\408fcc3f\cfebce5f\App_global.asax.6usl8oko.0.cs Line: 0 Stack Trace: [ArgumentNullException: Value cannot be null. Parameter name: contentType] EPiServer.Construction.Internal.ContentFactory.CreateContent(ContentType contentType, BuildingContext buildingContext) +459 EPiServer.Commerce.Catalog.Provider.Construction.Internal.CatalogContentFactory.CreateContent(ContentType contentType, BuildingContext buildingContext) +153 EPiServer.DataAccess.Internal.ContentDB.CreateContent(ContentType contentType) +14 EPiServer.DataAccess.Internal.ContentLoadDB.LoadContentInternal(ContentReference contentLink, Int32 languageBranchId, DbDataReader reader) +279 EPiServer.DataAccess.Internal.<>c__DisplayClass2_0.<Load>b__0() +286 EPiServer.Data.Providers.Internal.<>c__DisplayClass31_0`1.<Execute>b__0() +58 EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute(Func`1 method) +70 EPiServer.Core.<>c__DisplayClass121_0.<LoadContentFromCacheOrRepository>b__0() +35 EPiServer.Framework.Cache.ObjectInstanceCacheExtensions.ReadThroughWithWait(IObjectInstanceCache cache, String cacheKey, Func`1 readValue, Func`2 evictionPolicy) +981 EPiServer.Core.Internal.ContentInstanceCache.ReadThrough(ContentReference contentLink, String selectedLanguage, Func`1 readValue) +107 EPiServer.Core.ContentProvider.LoadContentFromCacheOrRepository(ContentReference contentreference, ILanguageSelector selector) +602 EPiServer.Core.Internal.ProviderPipelineImplementation.GetItem(ContentProvider provider, ContentReference contentLink, LoaderOptions loaderOptions) +309 EPiServer.Core.Internal.DefaultContentLoader.TryGet(ContentReference contentLink, LoaderOptions loaderOptions, T& content) +574 EPiServer.Core.Internal.DefaultContentLoader.TryGet(Guid contentGuid, T& content) +99 EPiServer.Core.Internal.DefaultContentRepository.TryGet(Guid contentGuid, T& content) +85 EPiServer.DataAbstraction.Internal.DefaultContentRootService.Register(String rootName, Guid contentRootId, ContentReference parentRoot) +190 EPiServer.Commerce.Initialization.InitializationModule.RegisterContentRoots(InitializationEngine context) +428 EPiServer.Commerce.Initialization.InitializationModule.Initialize(InitializationEngine context) +220 EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key) +58 EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context) +123 EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +248 [InitializationException: Initialize action failed for Initialize on class EPiServer.Commerce.Initialization.InitializationModule, EPiServer.Business.Commerce, Version=12.5.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7] EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +774 EPiServer.Framework.Initialization.InitializationEngine.ExecuteTransition(Boolean continueTransitions) +194 EPiServer.Framework.Initialization.InitializationModule.EngineExecute(HostType hostType, Action`1 engineAction) +876 EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +225 EPiServer.Global..ctor() +42 ASP.global_asax..ctor() in c:\Users\james.johnson\AppData\Local\Temp\Temporary ASP.NET Files\vs\408fcc3f\cfebce5f\App_global.asax.6usl8oko.0.cs:0 [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +139 System.Activator.CreateInstance(Type type, Boolean nonPublic) +105 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1431 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +184 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +27 System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +79 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +262 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +341 [HttpException (0x80004005): Exception has been thrown by the target of an invocation.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +523 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +107 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +688
There must still be some reference in there somewhere, are there any other tables you can think of that I'd need to check/delete some?
Cheers
I think you need to delete the content in tblContent which points to that deleted content type, but it should have the reference that prevents you from deleting the content type if a content of that type still exists.
I'm not sure what to suggest you now, it's probably the time to restore the databases and contact developer support service for help .
I'm currently performing an upgrade from Commerce v8 to v12.5 and having just done the database update and UTC conversions, I am now running into the following issue -
There is no 'SysCampaignFolder' in the DB, just a 'CampaignFolder', which may be part of the problem...?
The row for the 'CampaignFolder' is this: http://tinypic.com/r/2h67zas/9 (forum image upload not working for me atm, will try and swap it out for a non 3rd party shortly)
Does anyone have any experience with this? I'm really struggling to find many resources on it.
Cheers,
James