Recently I created a new web project, added some WCF web services to it and tried to debug them. To my suprise the WCF client application (WcfTestClient.exe) didn’t launch when I clicked Debug in Visual Studio. I went through all of the project options, looked online and couldn’t come up with anything. So, I started digging through project files. Here’s what I came up with.
Enable WCF Client on Debug
- Open Windows Explorer (Win+E).
- Navigate to your project’s folder (where the .csproj/.vbproj file is).
- Open the ProjectName.csproj file in your favorite editor.
- Navigate to the following XML location.
- Insert a blank line just above the closing </WebProjectProperties>
- Paste the following in the blank line.
- Save the project file and exit.
- Reload the project. Visual Studio will probably notify you that the project file has been modified.
- Ensure the WCF project is set as the Startup Project
- Right-click the project and select Set As Startup Project.
- Ensure the service you want to debug is set as the Start Page.
- Right-click the service file (.svc) the select Set As Start Page.
- Click Debug.
This should cause the WCF Client to run when the project is debugged. Happy Testing!