Reputation: 24906
New to C#, I noticed that creating services isn't something you can run in the Visual Studio 2017 interface for debug and step it through. At least, not that I'm aware. Instead, you have to create the service as you want it, hope it works, then use the service installer command (InstallUtil.exe
), and then yet you have no way to step it through for debug in order to check for issues. Compound this problem with needing to work with a client EXE that needs to talk to the service EXE on localhost over Named Pipes IPC/RPC using WCF.
So, what's the proper way to debug this? Should I instead just build a regular console app first, get the client GUI EXE (a Win Forms app) to talk to this console app over WCF, and then, when that works, copy the code from the console app into the service app and install the service?
Upvotes: 1
Views: 2787
Reputation: 4275
creating services isn't something you can run in the Visual Studio 2017 interface for debug and step it through.-You can debug as you debug C# or js for that matter.
You can create your service alone completely and wcftestclient.exe to debug and test service alone.
So, what's the proper way to debug this?
You can run wcftestclient.exe from Visual studio command prompt.
Right click on My Service Projects and Add the baseaddress where you had hosted the service.Below are the snapshots.
Put a debugger in VS where you want to debug and provide the inputs from this client GUI.The debugger will be hit.So you dont have to create a console app or anything to test WCF service.
Upvotes: 0
Reputation: 98
In Solution Explorer, right-click the solution name.
Click Set Startup Projects.
In the Solution Properties dialog box, select Multiple Startup Projects.
In the Multiple Startup Projects grid, on the line that corresponds to the server project, click Action and choose Start.
On the line that corresponds to the client project, click Action and choose Start.
Click OK.
for more information please visit https://msdn.microsoft.com/en-us/library/bb157685.aspx
Upvotes: 1