我已将一个非常简单的 WEB Api 项目部署到 Windows Azure 并收到以下错误:
Method not found: 'System.Web.Http.Services.DefaultServices System.Web.Http.HttpConfiguration.get_Services()'.
当我查看 bin 目录时,它似乎拥有与我的本地项目相同的所有 dll。那么我缺少什么二进制文件?
以下是 bin 中的文件:
Newtonsoft.Json.dll
System.Json.dll
System.Net.Http.dll
System.Net.Http.Formatting.dll
System.Net.Http.WebRequest.dll
System.Net.Http.xml
System.Web.Http.Common.dll
System.Web.Http.dll
System.Web.Http.WebHost.dll
MyApp.dll
触发它的代码在 Global.asax 中:
protected void Application_Start(object sender, EventArgs e)
{
GlobalConfiguration.Configuration.Routes.MapHttpRoute(name: "api", routeTemplate: "api/{controller}", defaults: new { controller = "MyApp" });
}