"There are multiple types with the same page type name" problem...

Sep 5, 2012 at 10:21 AM

Hi,

When moving the code to a own folder and changing namespace and then using the same database this error comes up. The strange thing is that there is no multiple pageTypes. Shouldn't PTB overwrite the existing one? I have tried to exclude the page type but then it goes to the next PageType and the sam error comes up. This is very enoying.

I have tried with everything but nothing seems to work. Also using a clean db but after a while this error shows up! I've also tried to set unique ids on all page types but then an error comes up that the ID already exists.

What to do here?

There are multiple types with the same page type name. The name is RSSPageType and the types are RSSPageType and RSSPageType.

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: PageTypeBuilder.PageTypeBuilderException: There are multiple types with the same page type name. The name is RSSPageType and the types are RSSPageType and RSSPageType.

Source Error: 

 

[No relevant source lines]


Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\b061c1b0\6c4fdca5\App_global.asax.pzjhvmki.0.cs    Line: 

Stack Trace: 

 

[PageTypeBuilderException: There are multiple types with the same page type name. The name is RSSPageType and the types are RSSPageType and RSSPageType.]

   PageTypeBuilder.Synchronization.Validation.PageTypeDefinitionValidator.ValidatePageTypesHaveGuidOrUniqueName(IEnumerable`1 pageTypeDefinitions) +809

   PageTypeBuilder.Synchronization.Validation.PageTypeDefinitionValidator.ValidatePageTypeDefinitions(IEnumerable`1 pageTypeDefinitions) +47

   PageTypeBuilder.Synchronization.PageTypeSynchronizer.SynchronizePageTypes() +96

   PageTypeBuilder.Initializer.Initialize(InitializationEngine context) +137

   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +647

   EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType) +115

   EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +199

   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +64

   EPiServer.Global..ctor() +74

   ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\b061c1b0\6c4fdca5\App_global.asax.pzjhvmki.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) +117

   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +247

   System.Activator.CreateInstance(Type type, Boolean nonPublic) +106

   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +12738733

   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28

   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +83

   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +315

   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375

 

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]

   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11700896

   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141

   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4869125

Feb 11, 2014 at 9:40 AM
The problem is exactly as the error message says: "There are multiple types with the same page type name".

Search your code for the specific name, "RSSPageType" in your case. The remove the old classes or rename their Name property in the PageType Attribute
[PageType(Name = "RSSPageType_Old" ... ]