有没有办法从部署的 Web Api 获取详细异常和堆栈跟踪?
即使我在 Debug模式下部署,我是否会获得详细的错误跟踪?
我从服务器 API 收到以下消息
"message": "Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details."
这仅发生在服务器中,相同的代码在本地机器上完美运行。
最佳答案
您是否检查了您正在执行的请求的内容类型?
有时这个错误是因为你没有指定这个值,例如 “应用程序/json”在请求的 header 中。
关于error-handling - 如何从已发布的 Web Api 中获取详细信息异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21289926/