無法在創建.NET Web API時在Visual Studio 2015中使用'swagger.net'。爲什麼? 我在創建基於.NET的Web API時遇到了一個錯誤。我已經安裝了swagger和相關的軟件包。在創建.net web api時無法在visual studio 2015中使用'swagger.net',爲什麼?
錯誤的:SwaggerActionFilter(),XmlCommentDocumentationProvider
我的功能是:
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");
}
}
誰編輯我的文章之前監測??? ... – Four
您的帖子被剪輯,以削減你的發誓,因爲它是毫無意義的。不過,你是否在Visual Studio的Project References中添加了對DLL的引用? –
很好...好的兄弟...可以請指導我這樣做... – Four