Try our conversational search powered by Generative AI!

AllowedTypesAttribute is only supported on ContentReference,ContentArea

jim
jim
Vote:
 

Any help would be appreciated. I am working to make a code change to the CMS 8.10 and I am getting a runtime error

From output

Exception thrown: 'EPiServer.Framework.Initialization.InitializationException' in EPiServer.Framework.dll

From browser

Version:1.0 StartHTML:000000186 EndHTML:000005867 StartFragment:000001482 EndFragment:000005835 StartSelection:000001488 EndSelection:000005789 SourceURL:http://localhost:54357/ AllowedTypesAttribute is only supported on ContentReference,ContentArea Server Error in '/' Application.

AllowedTypesAttribute is only supported on ContentReference,ContentArea

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.NotSupportedException: AllowedTypesAttribute is only supported on ContentReference,ContentArea

Source Error:

[No relevant source lines]


Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\5096970a\7e3ebbd\App_global.asax.0.cs    Line: 0

Stack Trace:

[NotSupportedException: AllowedTypesAttribute is only supported on ContentReference,ContentArea]
   EPiServer.DataAbstraction.RuntimeModel.ContentDataAttributeScanningAssigner.AssignValuesToPropertyDefinition(PropertyDefinitionModel propertyDefinitionModel, PropertyInfo property, ContentTypeModel parentModel) +1729
   EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.AssignValuesToProperties(ContentTypeModel modelType) +360
   EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.AddModel(Type type) +94
   EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.RegisterModels() +262
   EPiServer.Initialization.ModelSyncInitialization.Initialize(InitializationEngine context) +393
   EPiServer.Framework.Initialization.ModuleNode.Execute(Action a, String key) +55
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +243

[InitializationException: Initialize action failed for Initialize on class EPiServer.Initialization.ModelSyncInitialization, EPiServer, Version=8.10.1.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +737
   EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType) +156
   EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +871
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +100
   EPiServer.Global..ctor() +108
   ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\5096970a\7e3ebbd\App_global.asax.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) +142
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +105
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1515
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +186
   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) +281
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +329

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +525
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +118
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +708
#188451
Feb 23, 2018 16:12
Vote:
 

It seems that you've added the AllowedTypes attribute to a property that doesn't support it.

See more here: 
https://world.episerver.com/documentation/Items/Developers-Guide/Episerver-CMS/8/Content/Properties/Property-types/Restricting-content-types-in-properties/

#188468
Feb 24, 2018 15:21
jim
Vote:
 

Erik

Here is the rub, the production site run just fine. This code was provided to me from the original developer as the current code. However I have found differences in the bin folder file versions. I believe that I will need to manually match up the development version to the production build.

#188531
Feb 26, 2018 17:25
* 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.