swagger-ui returns 500 after deployment

后端 未结 6 2235
夕颜
夕颜 2020-12-05 03:47

Out of the box configuration works perfectly on my machine, no problems at all.

But when I deploy to our test environment - I get the following message

6条回答
  •  猫巷女王i
    2020-12-05 04:31

    The issue is that running dotnet publish with -r Release does not produce XML file. However, dotnet publish with -r Debug does in fact produce the file. This explains why people are only getting this issue when they are deploying to environments OTHER than locally, then kicking themselves when the find the exception only occurs on prod.(ITS THE RELEASE) In order to reporoduce, simply run those command locally and view output directory and you should see the issue.

    (UPDATE) The fix for me was to actually go into .csproj file and add a line to ensure that the file was copied over always. Diff shown below

提交回复
热议问题