I often publish little samples in this blog based off MDbg (which generally show off the debugging services in some way; such as app to convert Pdb-->XML, or this harness to print all exceptions in an app). I generally call these apps "harnesses" because they run on another app (the debuggee). I've gotten some questions about how to build them, so here are some more details.
The big picture is that these samples just need a reference to the Mdbg dlls and then all else is good. We ship Mdbg as a source sample and also in the .NET 2.0 SDK. See here for a comparison. The key details are that:- the sample has full source for Mdbg. The sdk version does not. - the sample has 4 dlls to link against: Corapi, CorApi2, MdbgEng, MdbgExt. The sdk just has 1 dll, MdbgCore.The 2 versions are very close and most test apps could be compiled against either one.
Note MDbg requires .NET 2.0. So V1.1 users are some what out of luck.
Here are more details:
The easy way: Do it all in VS 2005If you have VS2005 installed (even the C# Express edition, which is free), then you can:
This is nice because then everything is in VS. You get intellisense for all of Mdbg, you can step between the new app and mdbg core, and you get Edit-and-continue support.
The harder way: Do it all on the Command line (no VS)
If you don't have VS, you can still build an Mdbg app on the command line.
Other alternatives:You could also download the mdbg sample and build that without VS, and then build the test app against that; all on the command line.Or you could build just your harness in VS, and then add a reference to mdbgcore.dll from the sdk.