Skip to content

WebActivator throws exception with latest version of ASP.NET MVC 4 #12

Closed
@joelnet

Description

@joelnet

I created a New ASP.NET MVC 4 Project and selected Web API as my template. This template installs the package Microsoft.Net.Http version 2.0.20710.0. If I upgrade this package to 2.1.10 (http://nuget.org/packages/Microsoft.Net.Http/2.1.10) WebActivator throws the following exception when I run the project...

Server Error in '/' Application.

Token 0x02000001 resolves to the special module type representing this module.
Parameter name: metadataToken

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.ArgumentException: Token 0x02000001 resolves to the special module type representing this module.
Parameter name: metadataToken

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: 


[ArgumentException: Token 0x02000001 resolves to the special module type representing this module.
Parameter name: metadataToken]
   System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +750
   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) +1281
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +1574
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean isDecoratedTargetSecurityTransparent) +460
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +470
   System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit) +563
   WebActivatorEx.AssemblyExtensions.GetActivationAttributes(Assembly assembly) +394
   WebActivatorEx.ActivationManager.RunActivationMethods(Boolean designerMode) +490
   WebActivatorEx.ActivationManager.RunPreStartMethods(Boolean designerMode) +286
   WebActivatorEx.ActivationManager.Run() +260

[InvalidOperationException: The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: Token 0x02000001 resolves to the special module type representing this module.
Parameter name: metadataToken.]
   System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +1247
   System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +356
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +424
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +431
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1458

[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: Token 0x02000001 resolves to the special module type representing this module.
Parameter name: metadataToken.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +1037
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +392
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +578

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions