views:

55

answers:

1

When I hit F5 to debug an application, there are usually more moving parts in terms of processes than the one process associaed with the project that is considered the "startup application". For example, a web application makes calls to another (isolated) web application that hosts WCF web services. Both apps are in the same solution, both share/reference the same assemblies (also in the same solution), and both need to be debugged at the same time.

I've given up on Visual Studio 2008 for obvious reasons, and I already use the Debugger menu to manually attach and I even sometimes write System.Diagnostics.Debugger.Attach() at startup but hate doing that; is it possible to configure Visual Studio 2010 to late-attach to multiple processes, i.e. multiple projects in the solution as they are started?

I understand that it's "difficult" for Visual Studio to know how to attach to multiple processes particularly if the secondary processes are "spawned" by the first process--Visual Studio won't have the PID of the secondary process up front.

However, if it's too "difficult" for Microsoft to create a one-size-fits-all debugger attachment implementation, it would be ideal if in the same concept as "pre-build" and "post-build" shell commands could also be applied to pre-debug and post-debug invocation macros and the System.Diagnostics.Debugger modified so that we can write a line or two of code that can cleanly late-attach to another process while in runtime, without a dialog. Or something.

+1  A: 

Are you debugging your services through IIS or Cassini? If you are starting the services directly in VisualStudio, you can in fact start multiple applications/services at the same time.

I don't have access to VS2010 at the moment, but in VS2005, I right-click on the solution in Solution Explorer and choose Properties. Under Common Properties select the Startup Project category. By default it will be set as "Single startup project." Change this to "Multiple startup projects" and set the Action for each project that you want to run. After this, pressing F5 will start all of the projects specified.

Pedro