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 }         );     } } 

and index page worked: enter image description here

but api detail page fail(page not found): enter image description here

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

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -