User-1732172875 posted
I have a REST service I've put together that runs fine locally but not when hosted.
When I send a request to the hosted service I get this response in Postman:
{
"Message": "Object reference not set to an instance of an object."
}
I've tried THREE different things to get more verbose error messages:
1. Adding <customErrors mode="Off"/> to the Web.Config
2. Adding GlobalConfiguration.Configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always; to Global.asax.cs
3. Adding config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always; to WebApiConfig.cs
But I still get only the crude error message shown above when I attempt to call one of my methods from
Postman.
Of course the exception could be anywhere, within the action handler or somewhere else in the controller or action filters.
Does anyone understand why we'd get just a basic one line error rather than stack traces etc, despite all of the above attempts?
We don't get this particular error when we test locally on a developer PC so it's vital that we get more detail here.
Thanks