Unable to use 'swagger.net' in visual studio 2015 while creating .NET web api. Why? I encountered an error while creating a web api based on .NET. I've installed swagger and related packages.
Error on: SwaggerActionFilter(), XmlCommentDocumentationProvider
My function is :
public static void PostStart()
{
var config = GlobalConfiguration.Configuration;
config.Filters.Add(new SwaggerActionFilter());
try
{
config.Services.Replace(typeof(IDocumentationProvider),
new XmlCommentDocumentationProvider(HttpContext.Current.Server.MapPath("~/bin/DigiCob.XML")));
}
catch (FileNotFoundException)
{
throw new Exception("Please enable \"XML documentation file\" in project properties with default (bin\\DigiCob.XML) value or edit value in App_Start\\SwaggerNet.cs");
}
}