title: How do I resolve the error "Attempt by security transparent method 'System.Web.Http.GlobalConfiguration.get_Configuration()
body: <p>I have created a solution with two projects: A MVC 4 and a Class Library.  The solution compiles and runs fine.  I then install-package 'Microsoft.AspNet.WebApi.OData -pre to pull in OData WebApi functionality. When I do, I get the following error at runtime:</p>
  
  <p>Attempt by security transparent method 'System.Web.Http.GlobalConfiguration.get_Configuration()' to access security critical type 'System.Web.Http.HttpConfiguration' failed.</p>
  
  <p>When  WebApiConfig.Register(GlobalConfiguration.Configuration) runs in Global.asax</p>
  
  <p>Once I do, uninstalling the package doesn't seem to fix.  It removes the OData components obviously, but then leaves whatever assembly is causing this.  removing with -RemoveDependencies removes ALL WebApi references in the library, and I'm unable to get it back in a working state.  </p>
  
  <p>What package hell am I in and how can I enable WebApi OData in a vanilla MVC4 app?</p>