Friday, February 19, 2010

How to debug Dll deployed to the GAC remotely

Remote debugging is a very nice tool from Microsoft, especially if you have an error in a machine other than your development one, and you want to know what's the problem.
Firstly: Here are the steps to configure it from MSDN team Click Here.
These steps working fine with the mentioned example in the video.
But, How to use it if you have a SharePoint solution deployed to the GAC?
I spent 2 hours trying to let it work, but the point is,  remote debugging doesn't work if you don't have the "pdb" file in the same path with the "dll", so you have to copy the  "pdb" file to the same path with the "dll" one (If the soultion name is mysolution so, mysolution.pdb and mysolution.dll are the files in your debug folder from Visual Studio).
So, Here is one of the secrets of the GAC folder.
1- Open this Path %windir%\assembly this is the Assembly folder.


2- Now, Open the following Path %windir%\assembly\GAC_MSIL



3- You will find that for each dll deployed in the GAC, there is a folder with the same name.
4- Open mysolution folder
5- You will find that inside this folder, there is a folder for each version.
6- Open the version folder, and copy the mysolution.pdb and mysolution.dll to that location.
7- Start remote debugging and have fun :-)
I tried these steps and it's working fine with me.

You are welcome to post Comment Or Questions.

3 comments:

  1. This is a nice article..
    Its very easy to understand ..
    And this article is using to learn something about it..
    asp.net, c#, javascript
    Thanks a lot..!

    ReplyDelete
  2. This article about GAC debugging rocks my world.

    ReplyDelete