在做Web API的文档自动生成时,本机调试都正常,发布到服务器上出现500错误

Swagger发布服务器时错误 500 : { "Message": "An error has occurred." }

500 : { "Message": "An error has occurred." } /api/swagger/docs/v1

原因是开发模式为Debug配置环境,发布服务器后在release模式下没找到对应的document xml配置文件

解决办法,在项目配置document的xml除了debug模式之外,在release也需要配置,如下图configuration选择配置环境

Swagger发布服务器时错误 500 : { "Message": "An error has occurred." }

相关文章:

  • 2021-12-10
  • 2021-06-20
  • 2021-06-15
  • 2021-03-30
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
  • 2022-12-23
猜你喜欢
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
相关资源
相似解决方案