Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I had a piece of code that was working perfectly on my dev server, but once I deployed to my test server it stopped. I've dug through the logs and haven't found anything useful.

I was wondering if there is a way to attach to the process on my test server from my dev box (where I have Visual Studio installed).

Is this possible?

share|improve this question
add comment

2 Answers

You can use VS Remote Debugging, however you will need a copy of Visual Studio installed on the SharePoint server. You can setup remote debugging as in normal ASP.NET apps (http://msdn.microsoft.com/en-us/library/bt727f1t.aspx).

To minimise this requirement in the future (or rebuild/deploy if you can and are still having trouble), I recommend having lots and lots of tracing, and using settings to control how much is written to logs. Then you can trace your app when you want to, and use relevant logs to identify issues. This is always very important for web applications in SharePoint and ASP.NET.

share|improve this answer
    
Just to be clear, when you say: you will need a copy of Visual Studio installed on the SharePoint server. The "SharePoint server" you are talking about is my Dev server and not my test server? –  Abe Miessler Dec 21 '11 at 23:21
    
No I am talking about your test server - teh debugging components have to be on the destination (in this case test) server. If you try to run the components remotely, you will likely run into problems with 32bit and 64bit issues (and others). –  Russell Dec 21 '11 at 23:24
2  
You do not have to install visual studio on the remote server, Remote Debugger can be installed independently of Visual Studio. –  Ryan Dec 22 '11 at 10:06
    
Remote debugger is a component that comes with visual studio... –  Russell Dec 22 '11 at 10:27
2  
Yes, but its a separate install. You dont have to install the full visual studio to install remote debugging monitor. Its meant for exactly this sort of scenario - debugging something running on a server without having to install VS on the server. –  Ryan Dec 22 '11 at 16:02
add comment

You can remotely debug SharePoint solutions just like any .NET solution. I've blogged about it SharePoint Remote Debugging, the main points are that:

  1. You are running Visual Sudio Remote Debugger (msvsmon.exe)
  2. You are using an account with permissions to debug.
  3. You have placed the pdb files in the approriate folder (usually in GAC)
  4. The version of code running on the remote server is exactly the same as in the Visual Studio project you have opened (If possible it is always good to perform fresh build and deployment before trying to debug.

Also for a more detailed guide on how to do it read Remote Debugging SharePoint 2010 Solutions. In particular for the remote debugging components you just need to copy them from a machine with Visual Studio:

Get Remote Debugging Bits Set up Pull the remote debugger folder from your VS2010 install at: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger over to the remote server. Note there is a 64 bit and a 32 bit version. Choose the correct one.

Make sure that the account that you use on your local machine also exists on the remote machine. They do not need to be in the same domain, but they must have the same name. Add the account to the appropriate group on the remote machine (administrators?).

Start the remote debugger “service” by double clicking on msvsmon.

Back on your local machine in VS2010, go to debug>attach to process and enter the domain, account and server that you are connecting to. NOTE that the account name is not necessarily your user account (ie the account you ensured exists on the remote machine above). It must be the account the THE REMOTE DEBUGGER IS RUNNING UNDER.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.