C# swagger 接口說明

1項目搜索NuGet包 swashbuckle
這裏寫圖片描述

2訪問連接:http://域名:端口/swagger

3 添加方法的註釋,在SwaggerSconfig.cs 的Register()方法裏,找到GetXmlCommentsPath 去掉這行代碼的註釋
並添加

 protected static string GetXmlCommentsPath()
 {
      return System.String.Format(@"{0}\bin\文件名.XML", System.AppDomain.CurrentDomain.BaseDirectory);
 }

4項目右鍵屬性 > 生成 > xml文檔文件 >填寫路徑與GetXmlCommentsPath方法裏面的路徑保持一致 如:bin\文件名.XML

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章