1

I'm writing a WCF application exposing two methods.

What I need is to exclude a method when to deploy on IIS because the method is only used when to investigate a service for tests.

Instead of doing it by hands I want to achieve it automatically.

How can it be possible?

4

3 回答 3

1

尝试在调试方法上添加这个

 #if DEBUG
    [OperationContract]
 #endif

然后你必须在发布模式下编译。

于 2013-06-07T08:40:21.880 回答
0

也许这可能有用:http: //msdn.microsoft.com/en-us/library/4y6tbswk.aspx

在定义#DEBUG 时,另请参阅:https ://stackoverflow.com/a/2104121/2462779 。

于 2013-06-07T08:31:42.360 回答
0

使用两种服务接口:一种有方法,一种没有方法。然后将适当的暴露给您的客户。

于 2013-06-07T09:11:30.583 回答