GlobalConfiguration.Configure() not present after Web API 2 and .NET 4.5.1 migration

后端 未结 11 1954
后悔当初
后悔当初 2020-12-02 08:24

I recently started following this guide to migrate my project to .NET 4.5.1 and Web Api 2.

The very first thing MS developer Rick Anderson asks you to do is change:<

11条回答
  •  既然无缘
    2020-12-02 08:37

    You may want to check that your project has Microsoft.AspNet.WebApi.WebHost installed. As it turns out, in my case, Microsoft.AspNet.WebApi.WebHost was installed in another project, but not the particular project that needed it. In your packages.config, check that a line like this is there:

    
    

    If that is not present, you don't have Microsoft.AspNet.WebApi.WebHost installed in your project. You can either install using Nuget Package Manager or through the Package Manager Console. To install from the Package Manager Console, run this command:

    Install-Package Microsoft.AspNet.WebApi.WebHost
    

提交回复
热议问题