Turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server

前端 未结 6 1513
[愿得一人]
[愿得一人] 2020-11-27 10:12

I have a WCF service that has been working perfectly, and something has changed and I don\'t know what.

I get this exception:

System.ServiceMo

6条回答
  •  有刺的猬
    2020-11-27 10:45

    If you want to do this by code, you can add the behavior like this:

    serviceHost.Description.Behaviors.Remove(
        typeof(ServiceDebugBehavior));
    serviceHost.Description.Behaviors.Add(
        new ServiceDebugBehavior { IncludeExceptionDetailInFaults = true });
    

提交回复
热议问题