Wednesday, September 13, 2006

Setting up Remote Debugging in Visual Studio .Net 2003

Driver Machine – Machine on which Visual Studio editor will be running to debug the application( It will have the source code ).
Target Machine – Machine on which Binary to be debugged will be present.

Steps –
1) Create a user account on Target Machine with the same user name and password as on the Driver Machine which will be used to debug the application. User should be member of Administrators or Debugger Users.
2) Following is the list of files which need to be there on Target machine to be able to debug the application remotely.

File- Full remote debugging- Native only
coloader.dll X
coloader.tlb X
cpde.dll X
csee.dll X
csm.dll X
dbgproxy.exe X
dbghelp.dll X X
diasymreader.dll X
jsee.dll X
NatDbgDM.dll X X
NatDbgTLNet.dll X X
mcee.dll X
mcee_cs.dat X
mcee_mc.dat X
mdm.exe X
mdmui.dll X
msdbg2.dll X
msdis130.dll X
mssdi98.dll X
mspdb71.dll X
msvcmon.exe X X
msvcp71.dll X X
msvcr71.dll X X
pdm.dll X
psapi.dll X X
shmetapdb.dll X
sqldbg.dll X
vjee.dat X
vs7jit.exe X

(X X means the file is required for both full remote debugging and native debugging and X means its not needed for native remote debugging)

These files are required to start debug monitor “MSVCMON” on Target machine. In addition binary to be debugged must be present on target with required components to run.
Now start the debug monitor as “msvcmon -tcpip” – by default it starts in pipe mode

The Remote Debug Monitor (Msvcmon) executable is installed in the Microsoft Visual Studio .NET 2003\Common7\Packages\Debugger directory.
you can find the required files from a Visual Studio.NET installation from above location.

3) Make sure the binary is build in debug mode .
4) We need to set some properties under Project Settings -> Debugging as follows

• Connection -> Remote via TCP/IP (Native Only)
(This not very secure way of doing it – pipe mode is more secure but slower also DCOM debugging should be used if security is an issue)
• Remote Machine -> IP of Target Machine
• Here Remote command should be set to the path to executable on Target Machine to debug.

Now you are all set to debug … set the break points or debug step by step. You can now debug the process on the Target machine as if it is on the local machine.


About This Blog


  © Blogger templates The Professional Template by 2008

Back to TOP