CodeKicks.com
Focus on Microsoft Technologies - Tutorials, Articles, Code Samples.

Thursday, September 21, 2006

Remotly Debugging ASP.NET Application

 used the following MSDN article to get me going and I’ve added a few things to 
streamline the process.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vctskInstallingRemoteDebugMonitor.asp

 

1.      Install Remote Debugging Components on the Target Machine

The target machine that you wish to run the application on while debugging needs to have
the remote debugging software components installed. You can install just the individual
DLLs or just run the Visual Studio .NET installer and only select the “Remote Components
Setup” option (this is how I installed it).

For more info check out the link below:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vxurfserversidesetup.asp

2.      Setup Your Visual Studio .NET Project

Open the properties window for your project in Visual Studio .NET. Under the
“Configuration Properties” folder in the “Debugging” set “Debugger Mode” from “Project”
to “Program”. You then need to enter the path and filename on the remote machine where
we will eventually copy the executable in the “Start Application” field, but you will
notice that this is still grayed out. Click on the “Apply” button and this field will be
enabled. For this example we will us the path and filename
“C:\RemoteDebug\RemoteDebugTest.exe”.
Set “Enable Remote Debugging” to TRUE and then enter the WINS name of the remote machine
in the “Remote Debug Machine” field (we will user RemoteXP for the name of our remote PC).
Click OK to save your changes.

3.      Copy The Executable To the Remote Machine

You have to have a copy of the executable on the remote machine
(in the directory we previously specified)
for remote debugging. But it is a big pain to remember to copy it again every time you
rebuild. I used the build events in Visual Studio to help automate this process.
Open the project properties window again and go to the “Build Events” section under
“Common Properties”. Click on the ellipsis in the “Post Build Event Command Line” field
to bring up the command window. Enter the following line:

DEL \\RemoteXP\\C$\RemoteDebug\*.* /Q

This will delete any previous versions of the executable. Hit enter and on the next line
enter:
COPY “$(TargetDir)*.exe” “\\RemoteXP\\C$\RemoteDebug\”

This will copy the application executable to the remote machine.
Click OK twice to save your changes. Now ever time you start the debug process and
the project is automatically built, the new application executable will be copied to
the remote machine. Now press F5! The app will start on the remote machine and you
will be able to step through your code on the local machine.

http://www.codeproject.com/useritems/remotely_debugging.asp

Post a Comment