Wednesday, May 21, 2008

.NET : Debugging a dll in Visual Studio 2005

So I wrote a .dll in C# (a class library project) which is called by a desktop application.

I set the Visual Studio debugger on the dll code, started the application and ...

nothing happened.

So off to Mr. Google and the answer is that you:

* Right click on the dll project in Solution Explorer.
* Click "Properties"
* Click "Debug"
* Click "Start External Program" and then browse to the application
* Save

Now when you hit F5 (Start Debugging), Visual Studio will start the application and the dll code will breakpoint.


1 comment:

Anonymous said...

I tried this, but my ClassLibrary project obviously won't have a .exe file and 'Start External Program' option would only accept .exe files. Please let me know that what should I do?