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

StackOverflow https://stackoverflow.com/questions/8943978

Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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:

  1. Right click on project containing svc file.
  2. Select Set as Startup project.
  3. Put a breakpoint on the methods you want to debug.
  4. Breakpoint should be Red.
  5. Make sure your app config file is pointing to the debug WCF service version that's currently running, ex:

http://localhost:12345/MyService.svc

  1. Run your app.

  2. When the app calls that WCF method, it should stop on breakpoint.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top