After viewing Scott Gu's address note in AspConf, I was delighted with trying to use Windows Azure websites with MVC4. I tried deploying an existing MVC application after reconfiguring it to target the .NET framework 4.0 instead of 4.5 and received the following error.
Since I already added a few NuGet packages, I thought this might have something to do with Ninject, so I created a new MVC project targeted at .NET 4.0 without NuGet packages and deployed to Windows Azure using Visual Studio 2012 RC publishing (right click web project) and I am still getting this error.
Does anyone know what is happening or how to solve this problem? Thanks in advance.
[TypeLoadException: Failed to load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089.]
System.ModuleHandle.ResolveType (module RuntimeModule, Int32 typeToken, IntPtr * typeInstArgs, Int32 typeInstCount, IntPtr * methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) +0
System.ModuleHandle.ResolveTypeHandleInternal (RuntimeModule module, Int32 typeToken, RuntimeTypeHandle [] typeInstantiationContext, RuntimeTypeHandle [] method InstantiationContext) +180
System.Reflection.RuntimeModule.ResolveType (Int32 metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) +192
System.Reflection.CustomAttribute.FilterCustomAttributeRecord (CustomAttributeRecord caRecord, region MetadataImport, Assembly & lastAptcaOkAssembly, RuntimeModule ukrashenModule, MetadataToken ukrashenToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object [] attributes, IList derivatives attributes, RuntimeType & AttributeType, IRuntimeMethodInfo & ctor, Boolean & ctorHasParameters , Boolean & isVarArg) +115
System.Reflection.CustomAttribute.GetCustomAttributes (RuntimeModule ukrashennyyModule, Int32 ukrashennyyMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList Derived attributes, Boolean isDecoratedTargetSecurityTransparent) +426 System.Reflection.CustomAttribute.GetCustomAttributes (RuntimeAssembly assembly, RuntimeType caType) +103
System.Reflection.RuntimeAssembly.GetCustomAttributes (type attributeType, Boolean inherit) +64
WebActivator.AssemblyExtensions.GetActivationAttributes (Assembly Assembly) +64 WebActivator.ActivationManager.RunActivationMethods () +143 WebActivator.ActivationManager.Run () +22
[InvalidOperationException: initializing a run before the application The Run method of type WebActivator.ActivationManager threw an exception with the following error message: Failed to 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) +423
System.Web.Compilation.BuildManager.CallPreStartInitMethods () +306
System.Web.Hosting.HostingEnvironment.Initialize (ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677
[HttpException (0x80004005): initializing the start before the application The Run method of type WebActivator.ActivationManager threw an exception with the following error message: Failed to load the type 'System.Runtime.CompilerServices.ExtensionAttribute' from the assembly 'mscorlib, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089 '..]
System.Web.HttpRuntime.FirstRequestInit (HttpContext context) +9090044 System.Web.HttpRuntime.EnsureFirstRequestInit (HttpContext context) +97 System.Web.HttpRuntime.ProcessRequestNotificationPrivate (IIS7WorkerRequest wr