views:

141

answers:

1

I have an ASP.NET web site uses a compiled DLL from another VS.NET solution (have the DLL's original solution--.cs files, .csproj, .sln, etc) as a reference. There's an exception coming up to the web site from this DLL and I'd like to debug it (the DLL). Can I do this? Can I drill down into the DLL, set break points, etc. somehow? I've heard of "attaching the debugger", but never done that, and certainly not with a DLL. What're the steps to do this? Thanks!

+2  A: 

This question is asking the same thing. The answer for it is basically to use Reflector to decompile the DLL and look a the code.

However if you have the solution, and all source code, for the DLL then you could change the reference to point to the other project instead of the DLL. Then you can step into the functions as you would any other in the code.

Another way, again if you have the code, is to run the application and attach to the process. To do this you would open the other solution in visual studio, and attach the debugger to the aspnet worker process (aspnet_wp or something like that if I recall correctly). This will allow you to set breakpoints and have them be hit when you go to the right parts of your website. It would be the asp worker process i you are browsing to the site in IE on your local IIS for example. If you are running it in VS then it is likely to be using the built in web browser. So you would need to attach to that.

There might be a way to do it if you have the pdb files for the dll as well, but I have never really tried to do that. I know that if you have the pdb files then you can get source back when using tools like WinDBG to debug.

Glenn Condron