WebApi HelpPage api detail page 404, when "api" prefix removed? -
.net4.7 + webapi5.23 + helppage5.23.
my webapiconfig.register:
public static class webapiconfig { public static void register(httpconfiguration config) { ... config.maphttpattributeroutes(); config.routes.maphttproute( name: "defaultapi", routetemplate: "{controller}/{action}/{id}", //note: there no "api/" prefix defaults: new { id = routeparameter.optional } ); } }
but api detail page fail(page not found):
please help, thank you.
routing bound getting confused between routing mvc controller or webapi controller since sharing same path.
if need web page show, create new method within helpcontroller returns new view.
if need json returned, can still create new method within helpcontroller that, change return type jsonresult.
hopefully gives enough understand what's going wrong, , therefore google next.
Comments
Post a Comment