c# - MVC WebApi endpoints do not work on production, but regular endpoints do -


i have asp.net mvc project runs locally. has controllers inherit controller , inherit apicontroller. routes below. when run project through visual studio locally, works perfectly. can hit endpoints , expected responses. when deploy cloud server (windows server 2008 r2), :controller endpoints work (those @ /p/{controller}/{action}). none of endpoints @ :apicontroller work. following error of them:

{"$id":"1","message":"no http resource found matches request uri 'http://domain/controller'.","messagedetail":"no type found matches controller named 'controller'."} 

my routes:

in routeconfig.cs:

routes.maproute(             name: "default",             url: "p/{controller}/{action}/{id}",             defaults: new { controller = "home", action = "redirect", id = urlparameter.optional }         ); 

in webapiconfig.cs:

    config.routes.maphttproute(         name: "defaultapi",         routetemplate: "{controller}",         defaults: new { }     ); 

i copied code new webapi project , works. must have been kind of configuration issue old project rather dependency missing on vm, still don't know real cause was.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -