Asp.net Web API returns non-descriptive error 500

你离开我真会死。 提交于 2019-12-03 01:02:22

Had the same problem.

For me adding the

    GlobalConfiguration.Configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;

in the WebApiConfig Register method helped.

After that I got nice detailed info about the error.

Here is some more info on MSDN

If it is a WCF webservice, you will have to turn the IncludeExceptionDetailInFaults flag of the ServiceBehavior attribute to true for the error to appear the way you want.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!