Answer the question
In order to leave comments, you need to log in
When running ASP.NET MVC 4 Web API with Microsoft ASP.NET Web API 2.2 for OData v4.0 installed, an exception occurs, is there any way to fix it?
Visual Studion 2012 creating an ASP.NET MVC 4 Web API template project. It accordingly successfully compiles and runs. But if you install Microsoft ASP.NET Web API 2.2 for OData v4.0 using Manage NuGet Packages,
it compiles successfully, but an exception occurs on startup: Exception
details: System.FieldAccessException: Method 'System.Web.Http.GlobalConfiguration..cctor ()" failed to access field "System.Web.Http.GlobalConfiguration.CS$<>9__CachedAnonymousMethodDelegate2".
Source Error:
Line 19: AreaRegistration.RegisterAllAreas();
Line 20:
Line 21: WebApiConfig.Register(GlobalConfiguration.Configuration);
Line 22: FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
Line 23: RouteConfig.RegisterRoutes(RouteTable.Routes);
Source file: c:\Users\User\Documents\Visual Studio 2012\Projects\MvcApplication2\MvcApplication2\Global.asax.cs Line: 21
What causes it and how can I fix it?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question