.Net framework 配置swagger
1、先添加Swashbuckle管理NuGet包
2、在生成文件里面点击XML文档文件、跟在取消显示警告里面添加1591;
3、在App_Start=》SwaggerConfig.cs=》EnableSwagger里面添加xml文件路径
1、
或者
//c.IncludeXmlComments(string.Format("{0}\bin\WebApiWX.xml", System.AppDomain.CurrentDomain.BaseDirectory)); c.IncludeXmlComments(GetXmlCommentPath(thisAssembly.GetName().Name));
private static string GetXmlCommentPath(string name) { var basePath = AppDomain.CurrentDomain.BaseDirectory; return string.Format(@"{0}\bin\{1}.XML",basePath, name); }
标签:bin,string,framework,添加,Net,swagger From: https://www.cnblogs.com/mvpbest/p/16987242.html