S
S
SMARTi2014-11-15 09:51:20
ASP.NET
SMARTi, 2014-11-15 09:51:20

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

1 answer(s)
A
asdz, 2014-11-16
@asdz

Perhaps leapfrog with assemblies, or rather links to them. Maybe remove the references from the project and then add manually to the necessary assemblies?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question