This article may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. To maintain the flow of the article, we've left these URLs in the text, but disabled the links.
|
Ken Spencer |
Debugging with Visual InterDev 6.0 |
You can debug applications running on a developer's workstation, assuming they are running Windows NT® Server with Microsoft Internet Information Server (IIS) 4.0 or Windows NT 4.0 Workstation with Personal Web Server (PWS). This is known as local hosting, since the application is running on the user's local system. Visual InterDev also lets developers debug client scripts on their workstation using a local copy of PWS in Windows 95 or Windows 98. This configuration does not support debugging of server script in ASP pages; this is supported only on Windows NT. Developers can also attach to and debug server scripts running in ASP pages on a remote installation of IIS. This lets you issue debugging commands across the network, but it is limited in that only one user at a time can use remote debugging on a server. Debugging an ASP application requires that the user performing the operation have a valid Administrator account and password on the IIS server. This requirement alone is enough to make you rethink how you will use the debug feature against production and development servers. Since only one user at a time can debug an application, it can create a bottleneck for teams developing apps on one server. Instead of debugging against a development or production server, developers can use the Visual InterDev 6.0 Local mode to build, test, and debug portions of the application in isolation from the rest of the team. Figure 1 shows a typical configuration. Each developer is running Visual InterDev on a workstation, hosted by Windows NT 4.0 (Workstation or Server). In addition, each developer's system is using either PWS or IIS for local Web hosting services, as recommended. This configuration lets developers debug applications, but restricts their access to the Administrator password to their own workstation. It also offers optimal performance since the application will only slow down the user's own development system. |
Figure 1: Local/Master Debugging Configuration |
The configuration shown in Figure 1 allows users to employ the Local/Master mode to debug and manage applications. When the developer needs to debug an application running on the development server, they switch the application to Local mode. A complete copy of the site is replicated to a local Web server running on the developer's machine. In Local mode, the app is debugged and changes are saved on the developer's machine in isolation from the rest of the team. When they are ready to update the server, they switch back to Master mode and the changes are synchronized with the master copy. The basic system components required for debugging ASP code with Visual InterDev 6.0 are:
Service Pack 4 contains a large number of bug fixes for IIS, but it was not available until after Visual Studio 6.0 shipped. A small number of these bugs are debugging-specific. To remedy the situation until Service Pack 4 was released, the IIS group released a patch that contains the fixes needed for debugging. The patch changes only one file, asp.dll, and will not change its version number so all other setups, including Service Pack 4, will update it correctly later. Windows NT 4.0 Service Pack 4 includes the patch, so you do not need to install both updates. If any of this software is not installed, then debugging will not work correctly. Proper Installation
The first step in properly configuring Visual InterDev for debugging goes back to installing it on the server or workstation. If you are using the suggested configuration described earlier, then a developer workstation can serve as both client and server. |
|
When you run viddbg.exe with the /server option and the server applications are not set up correctly, you might see output similar to Figure 2. There are several interesting things about this output. In the DCOM permissions section, the following two items are shown with the permissions status Using Default Permissions: |
|
This means they use the default DCOM permissions. This is not the correct permission for the Catalog class to use with remote debugging. The section starting with the header ASP.DLL Version Information shows the version information for the ASP processor. The first part shows you the version of the asp.dll installed. This is the component that was updated with the asp2fix1.exe patch or Windows NT 4.0 Service Pack 4. You can tell that the patch has been applied to this system successfully by checking the version number and size for the installed asp.dllthey should be the same as the required DLL. The real problem for this particular system is shown in the VID Server Components section of the output. Notice that both entries under this heading show an error. This results in the last line of the output that states: "***VID Server Components are not installed correctly.***" How do you fix this? The first step is to set up Visual InterDev correctly. This involves installing the Visual InterDev server components on the system that will perform the debugging operation. The following steps can be used to install the Visual InterDev server components. These steps work if you already have the Visual InterDev client installed and just need the server components.
|
Figure 3: Running BackOffice Installation Wizard |
Once you have installed the hotfix, you should be ready to debug applications running on the system on which you installed the server updates. If this system is running IIS, you can debug locally if Visual InterDev is installed on the server, but remote developers cannot debug on this system. This is because the DCOM permissions required for debugging are not yet set correctly. If the system is a workstation running Windows NT 4.0 (Server or Workstation), then you can debug applications that are hosted by the Web server locally or running in Local mode. |
Figure 4: Custom Installation Option |
If you are installing Visual InterDev for the first time on a system, you need to take a couple of additional steps. These are similar to those in the previous list, but they include installing the Windows NT Option Pack and its related components:
Note: if the Windows NT Option Pack is reinstalled on a system after you have configured the debugging options, the Remote Machine Debugging component must also be reinstalled. Now you can configure the system for remote debugging to allow other developers to remotely debug apps. This step involves configuring DCOM permissions for the users who will debug remotely. The permissions can be set using the DCOM Configuration Manager utility. You must be logged on as an Administrator to make these changes. The steps are:
|
Figure 5: Selecting Catalog Class Options |
When the machine restarts, the new users will have permission to debug. By default, the user who is logged on
when the Remote Machine Debugging Server Setup runs will be given permission to debug the server on that machine. Anyone other than this user must be added using the preceding steps. Conclusion
Now you should be able to debug your applications locally or remotely. If you have any problems, review the setup and troubleshooting sections of the debugging whitepaper mentioned at the beginning of this column. I have successfully used the steps outlined in this column on a number of systems. |
http://msdn.microsoft.com/workshop/server/components/daciisperf.asp |
From the February 1999 issue of Microsoft Internet Developer.