다음을 통해 공유


Debugging server-side script loaded in an ASP page using Visual Studio 2005

If you are using Visual Studio 2005 and you are an ASP developer, you will notice that the debugging experience is different from the previous VS versions. Basically VS 2005 doesn't offer the same level of support for legacy ASP debugging as the previous versions and this is because it is mostly targeted towards the ASP.NET developers. However, the ASP developers were not totally forgotten, there is away to do this in VS2005, only it requires some manual setup. Here are the steps you need to do to be able to debug server side script in an ASP page that is part of an IIS Web application:

1. Create ASP.NET web app. Add the ASP page to it, set it as startup page.

2. In IIS manager, open the property page of the virtual directory of the application. On the Directory tab, click the Configuration button.

3. On the Debugging tab, enable both checkboxes in the "Debugging Flags" group.

4. Reset IIS (run iisreset from a command prompt)

5. Ctrl+F5 in VS to launch the ASP page in Internet Explorer.

6. Open the Debug | Attach to Process dialog. If you are using IIS6 (Win 2003), look for a process named w3wp.exe, otherwise, look for aspnet_wp.exe that has Script available in the Type column. Attach to this process using Script code type.

7. Open the Debug | Windows | Script Explorer window. Your .ASP page should show up in there.

8. Open your .ASP page from the Script Explorer window by double-clicking on it.

9. Set your BP in the ASP page opened this way. The BP should be hit when you refresh the ASP page in IE.

Note that only steps 5-9 need to be performed every time you want to debug, the rest of them you only need to do once for every web app you want to configure.

Hope this helps!