U4-1708 - Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib ...'

Created by Murray Roke 13 Feb 2013, 20:28:45 Updated by Shannon Deminick 21 Jun 2017, 07:55:52

I noted this exception in an umbraco rest extensions when running on a machine with .net 4.0 but without .net 4.5 installed (installing .net 4.5 on target platform fixed the issue) see details of the diagnosis and solution here: http://stackoverflow.com/questions/13748055/could-not-load-type-system-runtime-compilerservices-extensionattribute-from-as http://www.mattwrock.com/post/2012/02/29/What-you-should-know-about-running-ILMerge-on-Net-45-Beta-assemblies-targeting-Net-40.aspx

I'm not 100% sure that this issue is in umbraco (it could be in my app, however I'm not using ILMerge ....)

stack trace [TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.] System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) +0 System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +180 System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +192 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) +115 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +426 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) +167 System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit) +65 Umbraco.Core.<>c__DisplayClass13.b__11(Type t) +36 System.Linq.WhereArrayIterator1.MoveNext() +55 System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) +395 Umbraco.Core.TypeFinder.FindClassesWithAttribute(Type type, IEnumerable1 assemblies, Boolean onlyConcreteClasses) +231 Umbraco.Core.TypeFinder.FindClassesWithAttribute(IEnumerable1 assemblies, Boolean onlyConcreteClasses) +63 Umbraco.Core.TypeFinder.FindClassesWithAttribute(IEnumerable1 assemblies) +45 Umbraco.Core.PluginManager.b__1e() +64 Umbraco.Core.PluginManager.LoadViaScanningAndUpdateCacheFile(TypeList typeList, TypeResolutionKind resolutionKind, Func1 finder) +52 Umbraco.Core.PluginManager.ResolveTypes(Func1 finder, TypeResolutionKind resolutionType, Boolean cacheResult) +1091 Umbraco.Core.PluginManager.ResolveAttributedTypes(Boolean cacheResult) +137 Umbraco.Web.BaseRest.RestExtensionMethodInfo.GetFromAttribute(String extensionAlias, String methodName) +225 Umbraco.Web.BaseRest.RestExtensionMethodInfo.GetMethod(String extensionAlias, String methodName) +36 Umbraco.Web.BaseRest.BaseRestHandler.ProcessRequest(HttpContext context) +425 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Comments

Shannon Deminick 21 Jun 2017, 07:55:52

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/


Priority: Normal

Type: Bug

State: Closed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 4.11.4

Due in version:

Sprint:

Story Points:

Cycle: