slolife
slolife

Reputation: 19870

Windows Azure and Web API deployment

I have deployed a very simple WEB Api project to Windows Azure and am getting the following error:

 Method not found: 'System.Web.Http.Services.DefaultServices System.Web.Http.HttpConfiguration.get_Services()'.

When I look at the bin directory it appears to have all of the same dlls that my local project has. So what binary am I missing?

Here are the files in the 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

The code that is triggering it is in Global.asax:

protected void Application_Start(object sender, EventArgs e)
{
    GlobalConfiguration.Configuration.Routes.MapHttpRoute(name: "api", routeTemplate: "api/{controller}", defaults: new { controller = "MyApp" });
}

Upvotes: 2

Views: 720

Answers (2)

Filip W
Filip W

Reputation: 27187

This error suggests the presence of Web API Beta dlls.

Since Beta sits in the GAC it's not that easy to get rid of, the easiest way is to uninstall MVC4 and install again, making sure you get RC version.

Upvotes: 4

slolife
slolife

Reputation: 19870

I must have had an old version of the MVC 4 bundle. I uninstall, re-downloaded, re-installed, re-deployed and everything is working now.

Upvotes: 1

Related Questions