Try our conversational search powered by Generative AI!

Could not load type 'EPiServer.Shell.ObjectEditing.AllowedTypesAttribute' from assembly

Vote:
 

I have to upgrade from 7.19 to 8.0. After I built and upgraded the database, I get the following error 500 - internal server error. In the projects I find no reference to that class.

Exception information:
Exception type: TargetInvocationException
Exception message: Exception has been thrown by the target of an invocation.
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)

Initialize action failed for Initialize on class EPiServer.Initialization.ModelSyncInitialization, EPiServer, Version=8.0.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7
at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()
at EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType)
at EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType)
at EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType)
at EPiServer.Global..ctor()
at Internwebb.Global..ctor()
at ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\26beb5ea\ba4c5003\App_global.asax.0.cs:line 0

Could not load type 'EPiServer.Shell.ObjectEditing.AllowedTypesAttribute' from assembly 'EPiServer.Shell, Version=8.0.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'.
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 attributeCtorToken, Boolean mustBeInheritable)
at System.Reflection.CustomAttribute.IsDefined(RuntimePropertyInfo property, RuntimeType caType)
at System.Attribute.InternalIsDefined(PropertyInfo element, Type attributeType, Boolean inherit)
at EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.d__a.MoveNext()
at EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.AssignValuesToProperties(ContentTypeModel modelType)
at EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.AddModel(Type type)
at EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.RegisterModels()
at EPiServer.Initialization.ModelSyncInitialization.Initialize(InitializationEngine context)
at EPiServer.Framework.Initialization.ModuleNode.Execute(Action a, String key)
at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()

Stack trace: at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)

#149380
May 31, 2016 8:59
Vote:
 

Not sure if that might help, but you can try to increase log verbosity and see which type is being synced with fails (not quite sure that EPiServer keeps track on individual models that are synced).

However - from exception looks like somebody is looking in different assembly for AllowedTypes attribute. AFAIK it should exist in EPiServer.dll instead of EPiServer.Shell.dll

#149453
Jun 01, 2016 10:41
Vote:
 

Thanks for the tip Valdis. I changed the episerverlog.config tag level value=all. Unfortunately, there was not much more in the log.

2016-06-01 12:49:58,931 [55] ERROR EPiServer.Personalization.Providers.MaxMind.GeolocationProvider: Geolocation database file cannot be found: C:\Program Files (x86)\EPiServer\Framework\7.5.394.2\Geolocation\GeoLiteCity.dat
2016-06-01 12:50:00,289 [55] ERROR EPiServer.Framework.Initialization.InitializationEngine: Initialize action failed for Initialize on class EPiServer.Initialization.ModelSyncInitialization, EPiServer, Version=8.0.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7
System.TypeLoadException: Could not load type 'EPiServer.Shell.ObjectEditing.AllowedTypesAttribute' from assembly 'EPiServer.Shell, Version=8.0.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'.
   at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
   at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
   at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
   at System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 attributeCtorToken, Boolean mustBeInheritable)
   at System.Reflection.CustomAttribute.IsDefined(RuntimePropertyInfo property, RuntimeType caType)
   at System.Attribute.InternalIsDefined(PropertyInfo element, Type attributeType, Boolean inherit)
   at EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.<GetProperties>d__a.MoveNext()
   at EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.AssignValuesToProperties(ContentTypeModel modelType)
   at EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.AddModel(Type type)
   at EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.RegisterModels()
   at EPiServer.Initialization.ModelSyncInitialization.Initialize(InitializationEngine context)
   at EPiServer.Framework.Initialization.ModuleNode.Execute(Action a, String key)
   at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()
System.TypeLoadException: Could not load type 'EPiServer.Shell.ObjectEditing.AllowedTypesAttribute' from assembly 'EPiServer.Shell, Version=8.0.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'.
   at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
   at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
   at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
   at System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 attributeCtorToken, Boolean mustBeInheritable)
   at System.Reflection.CustomAttribute.IsDefined(RuntimePropertyInfo property, RuntimeType caType)
   at System.Attribute.InternalIsDefined(PropertyInfo element, Type attributeType, Boolean inherit)
   at EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.<GetProperties>d__a.MoveNext()
   at EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.AssignValuesToProperties(ContentTypeModel modelType)
   at EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.AddModel(Type type)
   at EPiServer.DataAbstraction.RuntimeModel.ContentTypeModelScanner.RegisterModels()
   at EPiServer.Initialization.ModelSyncInitialization.Initialize(InitializationEngine context)
   at EPiServer.Framework.Initialization.ModuleNode.Execute(Action a, String key)
   at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()
#149469
Jun 01, 2016 12:58
Vote:
 

Hi,

You may be using the wrong attribute if the intent is to restrict the usage of certain types on your Content Model. The AllowedTypes attribute (placed in the EPiServer.DataAnnotations namespace, EPiServer assembly) should do the trick.

Hope that helped.

Casper Aagaard Rasmussen

#149472
Jun 01, 2016 13:48
* 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.