WCF : How to disable WCF Test Client

2019-01-31 23:15发布

I created a new WCF Application. It has a svc file & a code behind, When I try to debug (F5) then I see the following.

  1. If svc file is open & press F5 then it opens the web browser
  2. If code behind file is currently open & press F5 then WCF Test client opens.

Why there are different behavior? I do not want to use Test Client, how to disable it in the app so that it would not come again.

Atul Sureka

6条回答
小情绪 Triste *
2楼-- · 2019-01-31 23:53

To control the WCF Test Client auto-launch in Visual Studio 2015/2017 you can do the following:

Right-click the WCF Service Project in Solution Explorer, choose Properties, and click WCF Options tab. Clear the checkbox Start WCF Service Host when debugging another project in the same solution (that check box is enabled by default).

查看更多
该账号已被封号
3楼-- · 2019-01-31 23:55

Open your project properties, go to the Debug tab, under start options you will see something like /client:"WcfTestClient.exe"

delete that line.

For a WCF Service Application and WCF Workflow Service Application you need to modify the .csproj.user file. A full write up can be found here.

The key part is

    <WebProjectProperties>
      <EnableWcfTestClientForSVC>False</EnableWcfTestClientForSVC>
    </WebProjectProperties>
查看更多
forever°为你锁心
4楼-- · 2019-01-31 23:55

Right Click WCF Project -> Select Properties -> Debug In Debug, you can see the Command Line arguments specified as /client:"WcfTestClient.exe" Removing this won't fire up the test client when you run the service.

Regards,

Venkatarajan Arthanari

查看更多
小情绪 Triste *
5楼-- · 2019-01-31 23:56

I have been down this road MANY times over the years at different companies.... I forget and I found this page and while it is good advise for some, not helpful for me.

What DID fix this for a WCF application for me is this:

Note:  Visual Studio 2013  FYI

1. Right click on the your WCF project and click Properties
2. Click on left "Web" link/tab  --> Notice the Start Action Section
3. Check Radio Button   "Specific page"   
4. Enter your .svc example   Service1.svc  
5. Set project as startup and either hit F5 or right click and debug
6. Now the WCF Test Client launches   (for me at least) 

Hope this helps someone else.

查看更多
Rolldiameter
6楼-- · 2019-01-31 23:56

It is easier than that.

  • 1.- Open Project properties.
  • 2.- Debug tab
  • 3.- Remove the "/client:"WcfTestClient.exe" appearing in the "comand line arguments" textbox.
  • 4.- Done!
查看更多
Lonely孤独者°
7楼-- · 2019-02-01 00:01

for future view ... when i was in a svc file, and hit f5, it always start this utility ... i try the param in the project file, don't work ...

then, in property, i change the setting in web, from Current page, to my default page :)

now i don't have this utility popping each time :)

查看更多
登录 后发表回答