I have a webapi that runs on an IIS7.5 server. It has 3 controllers, and all 3 can be used to access the webapi from calls within my application.
I had a error wher
I found that these needed to be turned on in the GlobalConfiguration for the webapi itself:
1: config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.LocalOnly;
2: config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
3: config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Never;
The server actually determines how much detail to display, the default is LocalOnly.
Our logging method is not considered local, I guess because it is not actually built into the API itself, but because it is in a shared dll between multiple APIs.
I found this article to be very helpful.
I used this one:
GlobalConfiguration.Configuration.IncludeErrorDetailPolicy
= IncludeErrorDetailPolicy.Always;
in Global of API and it's succeed.