WCF : How to disable WCF Test Client - wcf

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.
If svc file is open & press F5 then it opens the web browser
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

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>

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.

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

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

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

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!

If you want to run the project in a browser,
Go to the properties of the project
Click -> Web
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

To disable WCF Service Test Client
In Solution Explorer right click on "Solution 'YourServiceName' "
and go to properties
In "Common Properties" select "startup project"
Enable "Current Selection" Radio button
Click "Apply"
Click "ok"
Now open which ever service you want to run, and hit F5. It will run the current service.

Related

How to Disable SSL on ASP.NET Core API 3.1 Project in Visual Studio 2019 16.8.3 Build?

How will you disable SSL if you already set it up when you create your project to not use it on the first place? If I will try to create a new ASP.NET API 3.1 project without SSL, it will work fine when you first run it.
But on my case, I want to run it using
Project
setting under Debug -> Launch option:
Under this option, the typical option you usually see like check or uncheck SSL is missing so I am not able to disable it. So when you run this API template, you will prompt by the usual "Trust SSL Certificate" dialog box.
On the first place, I already disable SSL when I create my project, that's why it is strange to see this dialog box.
But when I changed the settings back to
IIS Express
under Debug -> Launch option, it was already been disabled, and when I run it, it runs fine without any issue about SSL notification. Is this an issue on Project option only?
In Startup.cs try removing
//app.UseHttpsRedirection();
To disable the dialog box, if your project launch set to 'project' and you don't want to see that dialog box, you just need to enter your application URL in the button input box with HTTP protocol.
the default app URL is Https://loclahost:5001 or Https://localhost:5000 that you can be changed to any other URL such as http://localhost:27510
In Startup.cs try removing
//app.UseHttpsRedirection();
And in launchsettings.json:
"useSSL": false

Rest Service opens "WCF Test Client"

I am a beginner. And I have one REST Service in Visual Studio. Sometimes when I run the Rest Service. Everything works fine and one google chrome window opens with url as localhost. But sometimes when I do the same thing, instead of google chrome one window pops up. But Why this window opens. I just want my REST Service to be up and running. Kindly help.
It depends on which file in your project is currently selected. If you have a .svc file selected, the WCF Test Client will start. Otherwise the default will be your browser.

How to disable WCF Test Client - VS 2012

I have a new WCF Service Application, when I hit F5 to debug, the WCF Test Client always comes up, but I would like to disable it since I am using soapUI to test instead.
I have tried the answer here - https://stackoverflow.com/a/8441887/903056 but this XML node is no longer in the project file for VS 2012. I have tried several other things myself as well, such as changing default start page and trying to force debug to start a browser session instead.
This is realy frustrated but you can try one of the followings to disable the WCF test client:
1.Open the requested project properties and select the Web tab. Select
the Current Page radio button (I believe that the Specific Page
button is selected), Save the project and run(F5).
2.You can modified the prject XML (.csproj) file and add
<EnableWcfTestClientForSVCDefaultValue>False</EnableWcfTestClientForSVCDefaultValue>
attribute to <WebProjectProperties> node. That should be done by the
followings:
2.1 Unload the requested project (right click -> Unload Project).
2.2 Edit <ProjectName>.csproj (right click again on the project)
2.3 Look for WebProjectProperties node and add <EnableWcfTestClientForSVCDefaultValue>False</EnableWcfTestClientForSVCDefaultValue> to it.
2.4 Reload the poject.
I hope you will find that unswer helpfull..
A simple option that works for me (at least in Visual Studio 2012 Update 4):
Open the WCF project properties and go to the Web section. Set the Start Action setting to Don't open a page. Wait for a request from an external application.
After choosing that option I no longer see the WCF Test Client.
I personally usually choose this start action anyway, since I much prefer hitting F5 in my browser than having yet another tab opened each time I hit F5 in VS.
I found a reasonable work around. All I did was add an empty html page to the project, then right clicked on the html file in Solution Explorer and chose Set As Start Page. A debug session starts but it doesn't go to the WCF TestClient. Not elegant but works.
Old thread but found it while I was suffering the same frustration with VS2013. If you run the project (F5) with the (yourProject)\svc.cs file open in the VS editor then the WCF Client starts. If you hit F5 with any other file as the selected and focused file in the VS editor then IIS and the normal first web page starts.
Very simple when one knows.
I had a similar problem, and found this to be caused by the default Start Options under
> Solution Properties
> Debug
>Start Options
>Command line arguemnts:
it was listing a command line argument of /client:"WcfTestClient.exe" which was launching the test client. Simply removing this argument solved my problem.
No need to extra thing just do thing below.
Tools-->Option -->project and solution-->Build and Run and finally
check Only startup project and Dependencies on Run

Adding my application to the Finder's context menu?

I have an application that I'm developing that deals with files of any type. I would like the user to be able to right click on any type of file in the Finder and have my menu option show up. I understand you have to add your application as a service to do this, however, whatever I put in the service settings in my Info.plist doesn't do the trick. I do register my application as a service with OS X, and I know it works because under service preferences my application's service shows up. However, I don't think I'm passing it the right type of parameters, because I can't activate my service by right-clicking on a file.
Any help would be deeply appreciated.
Did you take a look at the Apple documentation?
Also, this might be useful: Writing a Snow Leopard Service for Finder.app

wcf : Service + Client in same solution, how to debug? I don't want to run 2 versions of VS 2010 at the same time

I have created an application which has a client (WPF) and the Server (WCF), the service is IIS hosted, currently I am having to have 2 versions of vs 2010. One loads the wcf service in IIS and the other in my windows application.
The problem with this is it takes so much resources.
It appears if the wcf service is "NOT" hosted in IIS then I can start two projects at the same time according to this http://msdn.microsoft.com/en-us/library/bb157685.aspx
But what are my other options?
I need to find the best way of being able to compile / run the 2 projects and able STEP INTO each when when in debug, without using too many resources or having more than one vs 2010 open at the same time.
You should be able to debug both from the same instance of Visual Studio if they are in the same solution. When you run your application from Visual Studio, open the Debug menu and choose Attach To Process, you need to attach the debugger to the ASP.NET worker process (aspnet_wp.exe), it should automatically attach to your client.
Open service and client code in VS. Open Debug menu. Attach to process. Hold the Ctrl key and select as many processes as you want to debug using Mouse click.
In your case, you can select the ASP NET worker process depending on the version of IIS and the client process.
The easiest way to debug your WCF service is to:
Right click on project containing svc file.
Select Set as Startup project.
Put a breakpoint on the methods you want to debug.
Breakpoint should be Red.
Make sure your app config file is pointing to the debug WCF service version that's currently running, ex:
http://localhost:12345/MyService.svc
Run your app.
When the app calls that WCF method, it should stop on breakpoint.