Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

654 views
Skip to first unread message

tom.p...@xlgroup.com

unread,
Apr 7, 2014, 3:26:09 PM4/7/14
to glasssite...@googlegroups.com
I recently upgraded to Glass v3 from v2.  I am getting this error across my web farm.  Any insight is appreciated.

Thanks.

Tom


Server Error in '/' Application.

Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.



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.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

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) +525
   System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +19
   System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +315
   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) +208
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +1171
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +146
   WebActivatorEx.AssemblyExtensions.GetActivationAttributes(Assembly assembly) +114
   WebActivatorEx.ActivationManager.RunActivationMethods(Boolean designerMode) +290
   WebActivatorEx.ActivationManager.RunPreStartMethods(Boolean designerMode) +47
   WebActivatorEx.ActivationManager.Run() +70

[InvalidOperationException: The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'..]
   System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +11811022
   System.Web.Compilation.BuildManager.CallPreStartInitMethods() +465
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1167

[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'..]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11799824
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4935077

Michael Edwards

unread,
Apr 7, 2014, 4:55:55 PM4/7/14
to glasssite...@googlegroups.com
Do you have .NET 4.5 installed? There was a couple of breaking changes in .NET 4.5 


--
You received this message because you are subscribed to the Google Groups "Glass.Sitecore.Mapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glasssitecorema...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paterno Tom

unread,
Apr 8, 2014, 8:51:20 AM4/8/14
to glasssite...@googlegroups.com

I do not have .NET Framework installed on my development workstation, or the farm.  I do not get the error in development.

 

Tom Paterno    Senior Web Developer

    XL Group    Fast Fast Forward

    VOIP: 203-3877    Office: 203-964-3877    Mobile: 203-703-8273

    XL Digital Technology Team    Seaview House 70 Seaview Avenue, Stamford CT 06902

--
You received this message because you are subscribed to a topic in the Google Groups "Glass.Sitecore.Mapper" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/glasssitecoremapper/E_4vF_WV2-I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to glasssitecorema...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.




CONFIDENTIALITY: This communication, including attachments, is for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, any use, copying, disclosure, or distribution or the taking of any action in reliance upon this information is strictly prohibited. If you are not the intended recipient, please notify the sender immediately and delete this communication and destroy all copies.

Michael Edwards

unread,
Apr 8, 2014, 10:17:50 AM4/8/14
to glasssite...@googlegroups.com
What you could try is removing the WebActivator references and then call

{namespace}.App_Start.GlassMapperSc.Start();

From the Application_Start in the Global.ascx.

tom.p...@xlgroup.com

unread,
Apr 8, 2014, 3:05:16 PM4/8/14
to glasssite...@googlegroups.com, mikeed...@googlemail.com
That removes that error, however looks there is still some issue with .NET 4.5 being sought:

Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)'.

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.MissingMethodException: Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)'.

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

<%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace:

[MissingMethodException: Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)'.]
   Glass.Mapper.Utilities.CreateConstructorDelegates(Type type) +0
   Glass.Mapper.Configuration.Attributes.AbstractTypeAttribute.Configure(Type type, AbstractTypeConfiguration config) +39
   Glass.Mapper.Sc.Configuration.Attributes.SitecoreTypeAttribute.Configure(Type type) +298
   Glass.Mapper.Configuration.Attributes.AttributeTypeLoader.LoadType(Type type) +204
   Glass.Mapper.Pipelines.ConfigurationResolver.Tasks.OnDemandResolver.OnDemandLoader`1.Load() +81
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +110
   System.Linq.Enumerable.Aggregate(IEnumerable`1 source, Func`3 func) +123
   Glass.Mapper.Context.Load(IConfigurationLoader[] loaders) +284
   Glass.Mapper.Pipelines.ConfigurationResolver.Tasks.OnDemandResolver.ConfigurationOnDemandResolverTask`1.Execute(ConfigurationResolverArgs args) +154
   Glass.Mapper.Pipelines.AbstractPipelineRunner`2.Run(T args) +201
   Glass.Mapper.AbstractService.InstantiateObject(AbstractTypeCreationContext abstractTypeCreationContext) +124
   Glass.Mapper.Sc.SitecoreService.CreateType(Type type, Item item, Boolean isLazy, Boolean inferType, Dictionary`2 parameters, Object[] constructorParameters) +311
   Glass.Mapper.Sc.SitecoreService.GetItem(Guid id, Boolean isLazy, Boolean inferType) +232
   XL.Website.Models.XL.Factory.MenuFactory.GetActiveMenuGuid(Item currentItem, XLSiteSegment segment) +489
   __ASP.FastObjectFactory_app_web_tngm4slw.Create_ASP_layouts_xl_sublayouts_rwd_homemenucontent_ascx() +36
   System.Web.UI.TemplateControl.LoadControl(IWebObjectFactory objectFactory, VirtualPath virtualPath, Type t, Object[] parameters) +235
   System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) +205
   Sitecore.Web.UI.WebControls.Sublayout.GetUserControl(Page page) +245
   Sitecore.Web.UI.WebControls.Sublayout.CreateChildControls() +332
   System.Web.UI.Control.EnsureChildControls() +182
   Sitecore.Layouts.Expander.Expand(Control control) +68
   Sitecore.Nexus.Web.NexusPlaceholderApi.  (Placeholder   ) +814
   Sitecore.Nexus.Web.NexusPlaceholderApi.CreateChildControls(Placeholder placeholder) +419
   System.Web.UI.Control.EnsureChildControls() +182
   Sitecore.Layouts.Expander.Expand(Control control) +68
   Sitecore.Layouts.Expander.Expand(Control control) +266
   Sitecore.Web.UI.WebControls.Sublayout.CreateChildControls() +456
   System.Web.UI.Control.EnsureChildControls() +182
   Sitecore.Layouts.Expander.Expand(Control control) +68
   Sitecore.Nexus.Web.NexusPlaceholderApi.  (Placeholder   ) +814
   Sitecore.Nexus.Web.NexusPlaceholderApi.CreateChildControls(Placeholder placeholder) +419
   System.Web.UI.Control.EnsureChildControls() +182
   Sitecore.Layouts.Expander.Expand(Control control) +68
   Sitecore.Layouts.Expander.Expand(Control control) +266
   Sitecore.Layouts.Expander.Expand(Control control) +266
   Sitecore.Layouts.Expander.Expand(Control control) +266
   Sitecore.Layouts.PageContext.Build() +48
   (Object , Object[] ) +83
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +191
   Sitecore.Layouts.PageContext.BuildControlTree(Object sender, EventArgs e) +211
   System.Web.UI.Page.PerformPreInit() +49
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1716

--

To unsubscribe from this group and stop receiving emails from it, send an email to glasssitecoremapper+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Glass.Sitecore.Mapper" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/glasssitecoremapper/E_4vF_WV2-I/unsubscribe.

To unsubscribe from this group and all its topics, send an email to glasssitecoremapper+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.




CONFIDENTIALITY: This communication, including attachments, is for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, any use, copying, disclosure, or distribution or the taking of any action in reliance upon this information is strictly prohibited. If you are not the intended recipient, please notify the sender immediately and delete this communication and destroy all copies.

--
You received this message because you are subscribed to the Google Groups "Glass.Sitecore.Mapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glasssitecoremapper+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages