通过安装NuGet Microsoft.AspNet.WebApi.WebHost解决了这个问题。Install-Package Microsoft.AspNet.WebApi.WebHost https://www.nuget.org/packages/Microsoft.AspNet.WebApi.WebHost/