The webapi.helppage package was added, but apiexplorer did not find anything

I have a .NET 4.5 MVC 4 project that I have added to it the webapi.helppage package via NuGet.

Then they added ApiController to my project below:

 public class ValuesController : ApiController { // GET api/values public IEnumerable<string> Get() { return new string[] { "value1", "value2" }; } // GET api/values/5 public string Get(int id) { return "value"; } // POST api/values public void Post([FromBody]string value) { } // PUT api/values/5 public void Put(int id, [FromBody]string value) { } // DELETE api/values/5 public void Delete(int id) { } } 

to see if the help page works, but returns an empty apidescription collection to call GetApiExplorer() :

  public ActionResult Index() { return View(Configuration.Services.GetApiExplorer().ApiDescriptions); } 

However, I can use an example api controller, for example, using /api/values .

Does anyone know why apidescription will not be found?

+1
c # asp.net-mvc asp.net-web-api
source share
1 answer

I created a new api web project and started adding NuGet to my installed packages one by one, and it turns out that Glimpse is what causes them not to display.

I found more information here: ASP.Net Web API Help Page returning empty output

and the most suitable work so far is to add below to the web.config glimpse section:

 <glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd"> <inspectors> <ignoredTypes> <add type="Glimpse.AspNet.Inspector.RoutesInspector, Glimpse.AspNet"/> </ignoredTypes> </inspectors> </glimpse> 
+1
source share

All Articles