1
Vote

PTB 1.x-2.0 Exception on pagetypes with same class name in different namespaces

description

When adding a new pagetype with the same class name as an existing but in different namespace, the existing one will be updated with the values from the new one and an exception is thrown.
 
When using GUID:
EPiServer.Framework.Initialization.InitializationEngine.InitializeModules - Initialize action failed for Initialize on class PageTypeBuilder.Initializer, PageTypeBuilder, Version=2.0.0.0, Culture=neutral, PublicKeyToken=6fb8762af0e6dbed
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add)
at PageTypeBuilder.PageTypeResolver.AddPageType(Int32 pageTypeID, Type pageTypeType)
at PageTypeBuilder.Synchronization.PageTypeSynchronizer.AddPageTypesToResolver(IEnumerable
1 pageTypeDefinitions)
at PageTypeBuilder.Synchronization.PageTypeSynchronizer.SynchronizePageTypes()
at PageTypeBuilder.Initializer.Initialize(InitializationEngine context)
at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()
 
Without GUID:
[NullReferenceException: Object reference not set to an instance of an object.]
PageTypeBuilder.Synchronization.PageDefinitionSynchronization.PageDefinitionSynchronizationEngine.GetExistingPageDefinition(IPageType pageType, PageTypePropertyDefinition propertyDefinition) +68
PageTypeBuilder.Synchronization.PageDefinitionSynchronization.PageDefinitionSynchronizationEngine.UpdatePageTypePropertyDefinitions(IPageType pageType, PageTypeDefinition pageTypeDefinition) +126
PageTypeBuilder.Synchronization.PageTypeSynchronizer.UpdatePageTypePropertyDefinitions(IEnumerable`1 pageTypeDefinitions) +132
PageTypeBuilder.Synchronization.PageTypeSynchronizer.SynchronizePageTypes() +225
PageTypeBuilder.Initializer.Initialize(InitializationEngine context) +117
EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +859
EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType) +115
EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +227
EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +56
EPiServer.Global..ctor() +76
Sigma.Global..ctor() +41
ASP.global_asax..ctor() +9
 
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +146
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +298
System.Activator.CreateInstance(Type type, Boolean nonPublic) +79
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +10364299
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +258
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +382

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11318198
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4348404

comments