Remote Debugging

The Visual InterDev debugger allows you to debug ASP scripts on remote IIS servers using a feature known as remote debugging. This feature is useful in several situations, for example when:

  • Debugging applications running on development servers.
  • Getting assistance from another developer to debug an application running on your system.
  • Debugging an application on an ISP's system before it goes to production.
  • Debugging a production application that has exposed an error.

Normally, you will debug server script in an ASP page by installing Visual InterDev and the Web server on the same system and debugging scripts locally on that system. This is how we recommend you approach debugging, as we outlined earlier in this chapter.

However, with remote debugging, you can attach the debugger running on your computer to a script running on the Web server and issue debugging commands across the network. This is certainly useful in the situations we mentioned above. The material in this section is not meant to suggest that you do all of your debugging remotely, only that you know how to set up remote debugging and to use it when it's appropriate for the task.

Remote debugging is similar to debugging locally, except for these two differences:

  • You must perform some extra setup steps before you can use remote debugging.
  • Only one user can utilize remote debugging on a server at a time.

Before you can use remote debugging, you set up the server running IIS. The first step is to be sure that the proper debugging components have been installed on the server. A full server installation of Visual InterDev will normally load the proper components. If you did not perform a full server installation, or if you are not sure that you did, you can follow these steps to update the server:

  1. On the IIS system, start the Visual Studio 6.0 (Enterprise Edition or Pro Edition) setup program.
  2. Click Add/Remove, and select Server Applications And Tools.
  3. On the next page, select Launch BackOffice Installation Wizard and then choose Install.
  4. When the BackOffice Business Solutions wizard is displayed, choose Custom and then choose Next.
  5. Proceed until you see the page displaying a list of components to install. Uncheck all components except Remote Machine Debugging and Visual InterDev Server.
  6. Complete the installation.

Remote debugging requires that anyone using this facility must have a valid Windows NT administration account. This account must be a member of the Administrators or Domain Admins groups. You can set this up with the NT User Manager utility. This step alone will give you pause about using Remote Debugging on a production server. If you either do not want to or cannot use this level of security, you can use a tool like PCAnyWhere32 on Windows NT to allow certain users to remotely access a copy of Visual InterDev running on the IIS server. This will not require the same security levels that remote debugging does.

The remote debugging process uses Distributed COM (DCOM) to communicate between the client and server computers. You must configure DCOM on the IIS server to allow a remote user to attach the debugger process on that server:

  1. Log in as an administrator on the server running IIS.
  2. From the Start menu, select the Run command.
  3. In the Open box, type Dcomcnfg.exe, and click OK to start the DCOM Configuration Manager.
  4. In the Distributed COM Configuration Properties window, select Machine Debug Manager.
  5. Click Properties to display the Machine Debug Manager Properties dialog box.
  6. Click Security to display the Security tab.
  7. Click the Use Custom Access Permissions radio button.
  8. Click the Edit button to display the Registry Value Permissions dialog box.
  9. Verify that Allow Access is selected in the Type Of Access list.
  10. Click the Add button to display the Add Users And Groups dialog box.
  11. Select the server's name from the List Names From list. The server name typically is in the form \\server and appears at the top of the list.
  12. Under Names, choose Administrators, click Add, and then click OK.
  13. Click OK once more to return to the Security tab.
  14. Click the Use Custom Launch Permissions radio button.
  15. Click the Edit button.
  16. Click the Add button to display the Add Users And Groups dialog box.
  17. Select the server's name from the List Names From list. Again, the server name typically is in the form \\server and appears at the top of the list.
  18. Under Names, choose Administrators, choose Add, and then choose OK.
  19. Click OK once more to return to the Security tab.
  20. Click OK to Return to the Distributed COM Configuration Properties window.
  21. Select MTS Client Export.
  22. Click the Properties button. Add the same custom access permissions that we did for the Machine Debug Manager.
  23. Return to the Distributed COM Configuration Properties window.
  24. Select the MTS Catalog 1.0 Object.
  25. Click the Properties button. Add the same custom access permissions that we did for the Machine Debug Manager.

Now you can debug the application remotely using Visual InterDev just as you would if Visual InterDev and IIS were running on the same system.

Running the Debugger Remotely

After the server has been configured for remote debugging, you can debug on the server in much the same way you do locally. You can launch a remote debugging session in the same way that you launch a normal debugging session:

  1. Launch a project using the debugger.
  2. Attach to a process that is already running on the server.

The debug process runs on the server the ASP application runs on. For instance, if your ASP application is running locally, your debug session will also run locally. If the ASP application is running on another server, the debug session will run on that server.

NOTE
Because remote debugging ties up process threads on the server, it is recommended that while a remote debugging session is in progress, other users avoid using the server.



Programming Microsoft Visual InterDev 6. 0
Programming Microsoft Visual InterDev 6.0
ISBN: 1572318147
EAN: 2147483647
Year: 2005
Pages: 143

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net