You can remotely debug SharePoint solutions just like any .NET solution.
I've blogged about it SharePoint Remote Debugging, the main points are that:
- You are running Visual Sudio Remote Debugger (msvsmon.exe)
- You are using an account with permissions to debug.
- You have placed the pdb files in the approriate folder (usually in GAC)
- 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.