Set IncludeExceptionDetailInFaults to true in code for WCF

前端 未结 2 1689
囚心锁ツ
囚心锁ツ 2021-01-30 07:56

How do I set IncludeExceptionDetailInFaults in code without using App.Config?

2条回答
  •  走了就别回头了
    2021-01-30 08:36

    You can also set it in the [ServiceBehavior] tag above your class declaration that inherits the interface

    [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    public class MyClass:IMyService
    {
    ...
    }
    

提交回复
热议问题