WCF : How to disable WCF Test Client
Asked Answered
L

8

26

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

Lightfingered answered 9/12, 2011 at 6:6 Comment(0)
D
32

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>
Dieselelectric answered 9/12, 2011 at 6:30 Comment(4)
This didn't work for me for VS 2013, I found my solution here: #15253017Spoonfeed
Adding the property to the project file worked perfectly for me. Thanks!Pitanga
Adding the property in VS2019 Worked for meOvershadow
I had to restart VS2022 before this fix worked properly.Adelaadelaida
F
5

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.

Folk answered 14/2, 2014 at 0:16 Comment(2)
Actually he was wanting to DISABLE the Test Client from starting up, your answer is for enabling it. To disable it for me, i went into Specific Page.. and made it blank. Then the project will launch in the Browser.Silo
Thank you very much. Even though you didn't provide the answer he wanted, you helped a lot. I was looking for something that enables WCF Test Client. I am glad you provided this answer.Ornithology
C
4

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

Confessional answered 9/12, 2011 at 6:29 Comment(2)
There is not debug option as this is WCF Application project type. I went to WCF Project -> Select Properties --> Web --> There are some option to under "Start Action". However I could not find anything where "/Client:WCFTestClient.exe" as parameter is getting passed.Lightfingered
I just found that if I open the csproj file in notepad & remove set the value of EnableWcfTestClientForSVCDefaultValue to False then test client stops coming. However I could not get any option from UI to change the value of EnableWcfTestClientForSVCDefaultValue. Am I missing anything?Lightfingered
H
2

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 :)

Heliograph answered 5/3, 2013 at 6:1 Comment(0)
V
2

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).

Votive answered 1/4, 2018 at 9:56 Comment(1)
I just found the same thing but found you have provided the answer first. This was perfect for debugging self host console etc.Innate
P
0

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!
Pontifex answered 13/9, 2018 at 9:34 Comment(0)
H
0

If you want to run the project in a browser,

  1. Go to the properties of the project
  2. Click -> Web
  3. In the servers section, mention the iis (iisexpress, local IIS) and specify the URL "http://localhost:11111/"

this will take the program to the browser

To take it only to wcf test client, follow the above steps, but the URL should point to the service. http://localhost:11111/yourservice.svc .. will do.

Thank you

Humanist answered 14/2, 2019 at 4:9 Comment(0)
U
0

To disable WCF Service Test Client

  1. In Solution Explorer right click on "Solution 'YourServiceName' " and go to properties
  2. In "Common Properties" select "startup project"
  3. Enable "Current Selection" Radio button
  4. Click "Apply"
  5. Click "ok"

Now open which ever service you want to run, and hit F5. It will run the current service.

Ultramontane answered 1/4, 2019 at 14:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.