Error messages returned from Web API method are omitted in non-dev environment

后端 未结 5 2100
臣服心动
臣服心动 2020-12-29 22:21

I have a Web API controller POST method that behaves fine locally and on the testing server. If everything goes well it returns:

new HttpResponseMessage( Htt         


        
5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-29 22:45

    It sounds like it could very well be your customErrors mode to me. WebAPI is running on top of ASP.NET (MVC), so it uses all the same web.config settings.

    If it is a test server, you could try turning customErrors off to verify.

    
        
    
    

提交回复
热议问题