廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 2670 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
gasonly1
數位造型
個人文章 個人相簿 個人日記 個人地圖
路人甲
級別: 路人甲 該用戶目前不上站
推文 x0 鮮花 x0
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[教學] Microsoft Visual InterDev 6.0 Debugging
Microsoft Visual InterDev 6.0 Debugging
Microsoft Corporation

October 1998
Revised: November 1999
Revised: January 2002 (new information to help you verify that the script file cache is on)

Summary: Provides answers and solutions to common questions and debugging problems. (42 printed pages) Covers:

Setting up client-only, local server, and remote debugging
Basic debugging operations
ASP, script, and local mode debugging
A list of common problems
Powerful, cross-process debugging is one of the most compelling features of Microsoft? Visual InterDev? version 6.0. Because several software components are involved in Visual InterDev 6.0 debugging (including system services like Internet Information Server), special consideration must be given to the setup and configuration of your Visual InterDev debugging environment. This document attempts to answer the most common questions and provide solutions to several common debugging problems.

Contents
Overview
Debugging in Visual InterDev 6.0
Terminology
Debugging Setup
Setting Up Client-Only Debugging
Setting Up Local Server Debugging
Setting Up Remote Debugging
Verifying Debugging Setup
Debugging Operations
Basic Debugging Operations
Enabling ASP Debugging from a Visual InterDev Web Project
Manually Enabling ASP Debugging
Debugging Client Script
Debugging Projects in Local Mode
Debugging Server Script
Remote Debugging
Common Problems

Overview
Debugging in Visual InterDev 6.0
The distributed nature of Web applications requires that developers be able to seamlessly debug application logic across both the client and the server, and attach to and debug processes running on remote servers. With Visual InterDev? 6.0, developers can now set breakpoints on both client- and server-side script, step through code, add "watch" variables, investigate the call stack, and debug remote Web servers.

Developers can choose from one of three debugging configurations in Visual InterDev. Each configuration enables a subset of Visual InterDev debugging capabilities. Of the several potential pitfalls to successfully debugging Visual InterDev applications, most are related to setup failures and incorrect security permissions. This article describes how to set up and use each configuration.

Client-only debugging
Visual InterDev 6.0 permits developers to debug client scripts running in HTML or Active Server Pages (ASP) pages against their local workstation using a local copy of Personal Web Server in Microsoft Windows? 95 or Windows? 98. This configuration does not support debugging of server script in ASP pages.

Local server debugging
Typically, individual developers use Local mode in Visual InterDev 6.0 to build, test, and debug portions of the application in isolation from the rest of the team. In this case, they run a local copy of Microsoft Internet Information Server (IIS) on their Windows NT? development machine to debug their Web pages before checking them into the master Web project. This is the recommended debugging configuration in Visual InterDev 6.0.

Remote debugging
Developers can also attach to and debug server scripts running in ASP pages on a remote IIS. This is a powerful feature that permits a developer to issue debugging commands across the network; however, it is limited in that only one user can use Remote Debugging on a server at a time.

Terminology
There are several terms and abbreviations that will be used in this article. Some or all of them may already be familiar to you. They are listed here for completeness:

MTS—Microsoft Transaction Server.
IIS—Microsoft Internet Information Server 4.0.
Out-of-proc—Out-of-process Webs. These will be executed within separate MTS (Mtx.exe) processes.
In-proc—In-process Webs. These will be executed within the IIS (Inetinfo.exe) process.
ASP—Active Server Pages.
SSL—Secure Sockets Layer.
JIT—Just-In-Time debugging.
Debugging Setup
Setting Up Client-Only Debugging
Client-Only Debugging permits developers to debug client scripts running in HTML pages against their local workstation using a local copy of Personal Web Server in Windows 95 or Windows 98.

It does not support debugging of client or server script in ASP pages.

Note The capabilities of Client-Only Debugging are a subset of those available in the recommended configuration (Local Server Debugging).
Basic requirements
Following are the basic requirements for Client-Only Debugging in Visual InterDev 6.0:

Microsoft Windows 95 or Microsoft Windows 98
Visual InterDev 6.0
Personal Web Server
Front Page Server Extensions
Installing the software
Install the software using these steps in the order listed:

Install Visual InterDev development environment

Insert installation compact disc 1 into your computer.
Setup.exe automatically runs the Installation Wizard. The wizard steps you through the installation process.
Note Depending on your selections and your current configuration, the wizard will prompt you to install different required components and to reboot Windows one or more times during the installation process. After each reboot, the wizard automatically returns to the proper step.
Follow the steps of the Installation Wizard until you are prompted to select either Install Visual InterDev 6.0 or Server Applications.
Select Install Visual InterDev 6.0 and click Install.
When prompted, select either a Typical or Custom installation.
After the Visual InterDev development environment has been installed on your computer, you are prompted to install MSDN?, the Microsoft Developer Network. Note that you need to install MSDN in order for F1 Help to work and to have access to the Visual InterDev documentation.
Install Personal Web Server

Note The following components are required for the PageNavbar design-time control (DTC), Remote Debugging, and for previewing Active Server Pages on your local machine. You may choose not to select these components if you do not want to take advantage of these features.
Select NT Option Pack Common Files and click Install. This launches the Microsoft Personal Web Server Setup.
When prompted to select Minimum, Typical, or Custom, select Custom.
When the list of components appears, select the following:
Common Program Files
Microsoft Data Access Components (MDAC) 1.5
Personal Web Server (PWS)
Transaction Server
Clear the remaining components. As you clear the other components, the wizard might display a message that warns you of various dependencies. You can click Yes to ignore the dependencies because you are using this computer as a client for Visual InterDev, not as a server.
Continue with the remaining steps of the Personal Web Server Setup.
When you return to the Server Setup screen, select FrontPage 98 Server Extensions and click Install.
Continue with the remaining steps of the wizard.
Enable client script debugging in ASP pages

When Personal Web Server (PWS) processes an ASP page, the resulting page sent to the browser can be considerably different than what you see when you edit the ASP page in the editor. Server script can generate new client content dynamically or, conversely, a large quantity of server script can result in only a few lines of client HTML output. This situation introduces problems when you set breakpoints in client script inside an ASP page because the line on which you set the breakpoint can move dramatically within the file by the time the page reaches the browser.

The following steps describe how to enable client-side debugging in ASP pages. Doing so specifies that PWS tracks the location of client script breakpoints in an ASP page, and passes the location of those breakpoints to Microsoft Internet Explorer so that Internet Explorer can stop at the correct locations.

Note If you intend to work exclusively with client script in .htm files, you do not need to enable client-side ASP debugging or perform the following procedure.
In the Visual InterDev Tools menu, select Options.
Click the Debugging category.
Under Script, make sure Insert breakpoints in Active Server Pages for breakpoints in client script is selected.
Click OK.
In the Visual InterDev Project Explorer, right-click the file you want to debug and select Set as Start Page.
Start the debugger.
Setting Up Local Server Debugging
The following apply to Local Server Debugging:

Permits individual developers to build, test, and debug portions of a Web application in isolation from the rest of the team
Can be used to debug client script, server script, or Microsoft Visual J++ components
Is the recommended debugging configuration in Visual InterDev 6.0
Basic requirements
Following are the basic requirements for Local Server Debugging in Visual InterDev 6.0:

Microsoft Windows NT 4.0 Server or Windows NT 4.0 Workstation
Internet Information Server 4.0 or higher or Personal Web Server for Windows NT 4.0 Workstation
Visual InterDev 6.0
Windows NT 4.0 Service Pack 3 or later
IIS Hotfix shipped with Visual InterDev or Windows NT 4.0 Service Pack 4 or later
FrontPage Server Extensions
Windows NT Administrator privileges
Installing the software
Install the software following these steps in the order listed:

Install Visual InterDev development environment

Insert installation compact disc 1 into your computer.
Setup.exe automatically runs the Installation Wizard. The wizard steps you through the installation process.
Note Depending on your selections and your current configuration, the wizard will prompt you to install different required components and to reboot Windows one or more times during the installation process. After each reboot, the wizard automatically returns to the proper step.
Follow the steps of the Installation Wizard until you are prompted to select either Install Visual InterDev 6.0 or Server Applications.
Select Install Visual InterDev 6.0 and click Install.
When prompted, select either a Typical or Custom installation.
After the Visual InterDev development environment has been installed on your computer, you are prompted to install MSDN. Note that you need to install MSDN in order for F1 Help to work and to have access to the Visual InterDev documentation.
Install server components

Next, select Launch BackOffice Installation Wizard and click Install.
The BackOffice Installation Wizard will prompt you to select a Custom or Visual InterDev Developer option. Select Custom and click Next.
Verify the disk space requirements and click Next.
Select Remote Machine Debugging, Visual InterDev Server, Front Page Server Extensions, and MS Data Access Components from the top level of the components list.
Note Remote Machine Debugging is another component of the BackOffice Server Wizard. It sets up the latest versions of the debugging components as well as some registry keys that allow Visual InterDev to connect to the Transaction Server for debugging. The stand-alone setup for this is located in the Scrpt_ss directory on CD1 of Visual InterDev Professional Edition, or CD2 of Visual Studio Professional or Enterprise Edition.
Note Visual InterDev Server is another component of the BackOffice Server Wizard. It is required for debugging. The stand-alone setup for this is located in the Vid_ss directory on CD1 of Visual InterDev Professional Edition, or CD2 of Visual Studio Professional or Enterprise Edition.
Note If the Windows NT Option Pack is reinstalled, the Remote Machine Debugging and Visual InterDev Server components must also be reinstalled.
Expand the Windows NT Option Pack node and select the following:
Internet Information Server
Microsoft Management Console (MMC)
NT Option Pack Common Files
Transaction Server
Note The default IIS installation will set up the needed components, but there are some that you may turn off without adverse effect. The FTP server, the NNTP server, and the SMTP server are all unnecessary for debugging. The NNTP and SMTP servers are only installed on Windows NT Server, whereas FTP server is an option for Windows NT Server and Windows NT Workstation.
Click Next and continue with the remaining steps of the BackOffice Installation Wizard.
Install ASP Hotfix or Windows NT 4.0 Service Pack 4 or Later

Windows NT 4.0 Service Packs 4 and later contain a large number of bug fixes for IIS, but they were not available until after Visual Studio 6.0 shipped. A small number of these bugs are debugging-specific, and can seriously hamper using the debugger productively. To remedy the situation until the Windows NT Service Packs were released, IIS released a Hotfix that contains the fixes needed for debugging. The Hotfix changes only one file, Asp.dll, and will not change its version number, so all other setups, including the Windows NT 4.0 Service Packs, will correctly update it later.

Note You may need to stop the Web services before installing the Hotfix or Service Packs in order for these program to correctly update the Asp.dll file. You can do this by stopping the "IIS Admin Service" from within the Services applet in Control Panel.
Run \Iis\WinNT\Asp2fix1.exe from the installation disc (see upcoming note).
For Visual InterDev Professional Edition, it's located on CD1.
For Visual Studio Professional Edition, it's located on CD2.
For Visual Studio Enterprise Edition, it's located on CD3.
Reboot when prompted.
The executable file is also included later in this document for your convenience. Note that this is the Windows NT version and will not work properly on machines running Windows 9x. When Windows NT 4.0 Service Pack 4 is available, it is recommended that you upgrade to it and stop relying on this Hotfix, which is meant as a temporary workaround.

Giving users permission to debug

To give users the ability to debug, log on to the machine as an administrator and follow these steps:

From the Start button, select Programs, and click Administrative Tools (Common).
Run User Manager for Domains.
Add the user's Windows NT account to the Administrators group.
From the Start button, click Run on the server computer.
Type Dcomcnfg.exe and click OK.
On the Applications tab, find Catalog Class (see Figure 1) and click the Properties button.


Figure 1. Applications tab

Note The Catalog Class and Machine Debug Manager items are installed with the BackOffice Installation Wizard and are part of the server components for Visual InterDev 6.0. If the Catalog Class and Machine Debug Manager applications do not show up in the Applications tab, see the section "Potential Errors or Problems."
This will open a dialog box titled Catalog Class Properties with four tabs. Click the Security tab.
Select Use custom access permissions and click Edit (see Figure 2).


Figure 2. Security tab

This launches the standard Windows NT Add/Remove users dialog box (see Figure 3). You can now add or remove any Windows NT user accounts or groups that you wish to have or deny permission. (The simplest way is to add the Administrators group because in step 1 you added all of the users that you want to allow Local Debugging into this group.)
Note Due to a Windows NT bug, the Interactive User account will not work for granting debugging access. Users logged on to the server will not be able to debug even though this would seem to allow it. This should be fixed in Windows NT 4.0 Service Pack 4.


Figure 3. Windows NT Add/Remove users dialog box

Click OK when you are finished making changes.
Repeat steps 5–8 for the Use custom launch permissions option.
Note In the Identity tab (see Figure 4), if The interactive user option is selected, make sure a member of the Administrators group is currently logged on to the machine while attempting to debug ASP pages. If the This user option is selected, make sure the specified user is a member of the Administrators group. Also, do not use The launching user option when configuring for the Machine Debug Manager application.


Figure 4. Identity tab

Click OK to close the Catalog Class Properties dialog box, select the Machine Debugger Manager from the Applications tab list box, and click the Properties button (see Figure 5).


Figure 5. Select the ???“Machine Debug Manager???”

Repeat steps 4–8 for the Machine Debug Manager.
Note Any user wanting to debug on this machine must have access to all four sets of DCOM permissions lists (access permission in Catalog Class, launch permission in Catalog Class, launch permission in Machine Debug Manager, launch permission in Machine Debug Manager) to ensure success.
Click OK to close the Dcomcnfg.exe dialog box.
Reboot the machine. When the machine restarts, the new users will have permission to debug.
Note You may notice that the Interactive User account is added to all of the classes that were mentioned earlier. It would seem that having this account added and logged on to the server would be all you need to enable a machine for debugging. This will not work, however, because of a bug in Windows NT, which is fixed in Windows NT 4.0 Service Pack 4. After Service Pack 4 is installed, users may log on to the remote server and expect Remote Debugging to work correctly, without following the preceding steps.
Automatically enable server script debugging in ASP pages

You can manually enable server-side debugging for your ASP application as described under "Manually Enabling ASP Debugging" later in this article. Alternatively, Visual InterDev can automatically enable debugging on the server as needed.

Note If you intend to work exclusively with client script in .htm files, you do not need to enable server debugging or perform the following procedure.
Note When automatically enabling server-side debugging, Visual InterDev will enable client-side debugging as well.
In the Visual InterDev Project Explorer, right-click the project and click Properties to display the Property Pages dialog box.
Click the Launch tab.
Under Server script, make sure Automatically enable ASP server-side debugging on launch is selected.
Click OK to close the Properties dialog box.
In the Visual InterDev Project Explorer, right-click the file you want to debug and select Set as Start Page.
From the Debug menu, select Launch, or click the Play button on the Project toolbar.
Note To debug script in ASP pages, you must be running version 4.0 or later of Microsoft Internet Information Server (IIS).
When these steps are followed, each time you start a debugging session Visual InterDev automatically configures the server for debugging. This includes the following:

Setting the IIS application to run in its own memory space. (In COM terms, it runs "out of process.")
Enabling the IIS application's debugging options.
Setting up an MTS package to allow you to attach the debugger to the Web application. The package's identify is set when you first start the debugging session by asking you to provide your name and password.
When you quit your debugging session, Visual InterDev restores the server debugging settings and out-of-process setting to their previous values.

Setting Up Remote Debugging
Remote Debugging permits developers to attach to and debug server scripts running in ASP pages on a remote IIS.

In addition, Remote Debugging is limited in that only one user can use Remote Debugging on a server at a time.

Basic requirements: client
Following are the basic requirements for the client machine for Remote Debugging:

Microsoft Windows NT 4.0 Workstation or higher or Microsoft Windows NT 4.0 Server or higher
Visual InterDev 6.0
Internet Information Server 4.0 or higher or Personal Web Server for Windows NT 4.0 Workstation
Basic requirements: server
Following are the basic requirements for the remote server machine in Remote Debugging:

Microsoft Windows NT 4.0 Server or Windows NT 4.0 Workstation
Internet Information Server 4.0 or higher or Personal Web Server for Windows NT 4.0 Workstation
Windows NT 4.0 Service Pack 3 or later
IIS Hotfix shipped with Visual InterDev or Windows NT 4.0 Service Pack 4 or later
FrontPage Server Extensions
Windows NT Administrator privileges
Client setup
To set up the client (developer's) machine follow these steps:

Install Visual InterDev development environment

Insert installation compact disc 1 into your computer.
Setup.exe automatically runs the Installation Wizard. The wizard steps you through the installation process.
Note Depending on your selections and your current configuration, the wizard will prompt you to install different required components and to reboot Windows one or more times during the installation process. After each reboot, the wizard automatically returns to the proper step.
Follow the steps of the Installation Wizard until you are prompted to select either Install Visual InterDev 6.0 or Server Applications.
Select Install Visual InterDev 6.0 and click Install.
When prompted, select either a Typical or Custom installation.
After the Visual InterDev development environment has been installed on your computer, you are prompted to install MSDN. Note that you need to install MSDN in order for F1 Help to work and to have access to the Visual InterDev documentation.
Install server components on client

Three server components are required for the client to be able to automatically set up debugging on the remote server: Common Files, Management Console, and Internet Service Manager.

Select Launch BackOffice Installation Wizard and click Install.
The BackOffice Installation Wizard will prompt you to select a Custom or Visual InterDev Developer option. Select Custom and click Next.
Verify the disk space requirements and click Next.
Expand the Windows NT Option Pack node and select:
Internet Service Manager
Microsoft Management Console
NT Option Pack Common Files
Note If you already have IIS installed, you need to make sure these three options are installed by going to Add/Remove in the Windows NT 4.0 Option Pack Setup. A side benefit to installing these components is that you can use the Internet Service Manager to administer the remote server.
Click Next and continue with the remaining steps of the BackOffice Installation Wizard.
Server setup
Install server components

To set up the server for Remote Debugging follow these steps:

Select Launch BackOffice Installation Wizard and click Install.
The BackOffice Installation Wizard will prompt you to select a Custom or Visual InterDev Developer option. Select Custom and click Next.
Verify the disk space requirements and click Next.
Select Remote Machine Debugging, Visual InterDev Server, Front Page Server Extensions, and MS Data Access Components from the top level of the components list.
Note Remote Machine Debugging is another component of the BackOffice Server Wizard. It sets up the latest versions of the debugging components as well as some registry keys that allow Visual InterDev to connect to the Transaction Server for debugging. The stand-alone setup for this is located in the Scrpt_ss directory on CD1 of Visual InterDev Professional Edition, or CD2 of Visual Studio Professional or Enterprise Edition.
Note Visual InterDev Server is another component of the BackOffice Server Wizard. It is required for debugging. The stand-alone setup for this is located in the Vid_ss directory on CD1 of Visual InterDev Professional Edition, or CD2 of Visual Studio Professional or Enterprise Edition.
Note If the Windows NT 4.0 Option Pack is reinstalled, the Remote Machine Debugging and Visual InterDev Server components must also be reinstalled.
Expand the Windows NT 4.0 Option Pack node and select the following:
Internet Information Server
Microsoft Management Console
NT Option Pack Common Files
Transaction Server
Note The default IIS installation will set up the needed components, but there are some that you may turn off without adverse effect. The FTP server, the NNTP server, and the SMTP server are all unnecessary for debugging. The NNTP and SMTP servers are only installed on Windows NT 4.0 Server, whereas FTP server is an option for Windows NT 4.0 Server and Windows NT 4.0 Workstation.
Click Next and continue with the remaining steps of the BackOffice Installation Wizard.
Install ASP Hotfix or Windows NT 4.0 Service Pack 4 or later

Windows NT 4.0 Service Packs 4 and later contain a large number of bug fixes for IIS, but they were not available until after Visual Studio 6.0 shipped. A small number of these bugs are debugging-specific and can seriously hamper using the debugger productively. To remedy the situation until the Windows NT Service Packs were released, IIS released a Hotfix that contains the fixes needed for debugging. The Hotfix changes only one file, Asp.dll, and will not change its version number, so all other setups, including the Windows NT 4.0 Service Packs, will correctly update it later.

Note You may need to stop the Web services before installing the Hotfix or Service Packs in order for these program to correctly update the Asp.dll file. You can do this by stopping the "IIS Admin Service" from within the Services applet in Control Panel.
Run \IIS\WinNT\ASP2FIX1.exe from the installation disc (see upcoming note).
For Vis ..

訪客只能看到部份內容,免費 加入會員 或由臉書 Google 可以看到全部內容




獻花 x0 回到頂端 [樓 主] From:廣東省 | Posted:2005-02-05 15:33 |
feng 手機
數位造型
個人文章 個人相簿 個人日記 個人地圖
小人物
級別: 小人物 該用戶目前不上站
推文 x0 鮮花 x9
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

為什麼不貼連結就好了呢? 貼上來也沒有排版、更沒有連圖都加上去~

原文自 MSDN
http://msdn.microsoft.com/library/default.asp?url=...ml/msdn_videbugging.asp

此文章被評分,最近評分記錄
財富:30 (by panasonic732)
支持度:10 (by panasonic732) | 理由: 感謝您的用心及提供


獻花 x0 回到頂端 [1 樓] From:台灣教育部 | Posted:2005-02-17 15:08 |
sonic0931 手機
數位造型
個人文章 個人相簿 個人日記 個人地圖
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x0 鮮花 x6
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

這位大大,真好心,不過我看,我可能要仙去練一下英文的經驗值才行 表情


獻花 x0 回到頂端 [2 樓] From:台灣中華電信 | Posted:2005-03-25 21:19 |

首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.059674 second(s),query:16 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言