30 Mar 2011

There is many ways to do debugging in Visual Studio, normally you just hit F5, compile & run the code with debugging. However sometimes you need to debug an executable you have already built or debug on another machine. I have mentioned this previously you can use the Attach to Process option to do debug MSCRM assemblies that exist on other machines and/or run by a executable you do not control.

image

This works great but recently I had an issue where the application would start and (silently) die within seconds, but only in test (never in dev). It just happened so quickly that I could not attach the debugger in time. So how can you debug that scenario?

Thankfully this is very easy, just go to your Visual Studio project settings and switch the Start Action to Start External Program, set the path to the executable and then hit F5!

image

What this will do is start the executable, attach the debugger and work with your code all for you – so no more racing against the attach to debugger options Smile

Comments

Jonathan Dickinson's picture

If you need to start multiple projects/applications you can also add the exe as an existing project (right click solution/solution folder -> Add -> Existing Project...).

In addition you might want to look at the additional options ASP.Net projects provide: the most useful one I have used is the "don't start a browser" one; as Chrome is my primary browser - which does not play well with the defaults at all (I land up with 50 000 tabs open).

Add new comment