HTTP resource not found, which matches the request URI

I just deployed my MVC application to a subdomain, and I just can't get webapi to work.

Access locally: local: 40052 / API / apiEmpreendimento / GetObjects works just fine, but access to the following online: http://subdomain.mysite.com/api/apiEmpreendimento/GetObjects

Gives me

{"Message": "An HTTP resource was not found that matches the request URI" http://subdomain.mysite.com/api/apiEmpreendimento/GetObjects ".}

App_Start / WebApiConfig.cs

public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{action}/{id}", defaults: new { action = "get", id = RouteParameter.Optional } ); } } 

Any advice is appreciated.

thanks

+6
source share
1 answer

I was thinking about the new WepApi. MVC understands this as a WebApi controller, Microsoft Reserved Api Controlller for itself, I changed the name of my controller with MyApiController and the problem is solved.

+2
source

All Articles