• This email address is being protected from spambots. You need JavaScript enabled to view it.

    Recent items


Saturday, 06 April 2013 19:18

Remote debugging with Visual Studio 2010 of a SharePoint application (in our case, the production environment)

Written by
Rate this item
(2 votes)

Today, saturday 06th April 2013, I and my friend This email address is being protected from spambots. You need JavaScript enabled to view it. (Ciccio for friends) are engaged to deploy a SharePoint solution in the Production enviroment. All is going done except a strange behavior of a component in home page.

After some checks into other environments, we are not able to find a solution of the problem. The only one way to find a possible solution is to debug the solution but we are in production environment. So, while Ciccio reassure the customer that we have the control of the problem, I start to collection informations how to remotly Debug the application.

First of all, we need to install into remote server (in our case, we select one front-end web server of production environment) the "Visual Studio 2010 Remote Debugger with Service Pack 1" tool. After configure the server with the Remote Debugger wizard, we are ready to start the dubug (the TCP ports are fortunately open to allow us to comunicate from another server).

After that, we need a server with Visual Studio Professional or Ultimate installed. We need to login with an user that have right permissions to add dlls into GAC of the Remote Server. We opened our solution and made to a build with debug mode. So, into bin folder, we have the .dll and .pdb files.

The next step is to copy the files into into the <dll name> directory stored into the GAC of the server . Actually, the GAC view is the following.


We need to change the GAC View to have a folder view. To do that, we must execute the following commands and the result is the next image.

Show/Hidden bash code

View source
start > run > cmd
type : "cd c:\windows\assembly"
type: "attrib -r -h -s desktop.ini"
type: "ren desktop.ini desktop.bak"

Now, from the "client" server, we need to navigate into the server GAC_MSIL folder to put the pdb and dll files. The server path is \\<ip address>\$c\windows\assembly\gac_msil\<dll name>\<dll version>.

Whenever we need to update the dll and pdb files, we make this steps:

  • Into the remote server, to unlock the dll, make an "iisreset /stop" command
  • Into the client server, copy the pdb and dll files from the bin folder to the remote dll path into gac_msil
  • Into the remote server, make an "iisreset /start" command.

Now, the last step is to run the Visual Studio debugger tool (into visual studio, click on debugger menu -> attach to process -> into qualifier field, insert the remote server ip address) and attacch to w3p processes of the remote server.

Magically, when we put a breack point, the circle turn red and we can debug the remote dll. We are very happy and with this way, we found the bug.

NOTE: our production environment is composed of one application server and two web front-end servers. All our test are executed on one web FE server. To exclued all request from users, we removed momentarily the FE from the balancer and to reach the FE from the "client server", we modify the hosts file of the "client server" adding an entry with the FE ip address and the application host name..


Read 56400 times Last modified on Tuesday, 12 January 2016 10:37

1 comment

  • Comment Link Tuesday, 01 July 2014 22:50 posted by

    I'm not certain the place you are getting your information, however good topic.

    I needs to spend some time finding out much more or working out more.
    Thanks for magnificent info I used to be looking for this info for my


Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.