开发者

How do you Debug/Run classic asp pages in Visual Studio 2008?

开发者 https://www.devze.com 2022-12-11 21:43 出处:网络
Whenever I try to open a classic asp page while running the site in VS2008 I get the e开发者_运维知识库rror: \"This type of page is not served\".

Whenever I try to open a classic asp page while running the site in VS2008 I get the e开发者_运维知识库rror: "This type of page is not served".

How do you Debug/Run classic asp pages in Visual Studio 2008?

AnthonyWJones has the correct answer but it is not letting me select an answer for some reason.

Here is a tutorial I found that goes into more details how to set up VS2008 and XP to debug classic asp


The Developer Web Server (Cassini) only supports ASP.NET and static content.

You need an instance of IIS running on your dev machine.

Windows XP

On XP you need to modify the Default Web site so that either its home directory is pointing at your sites root folder or create a new virtual directory and configure it as an application. In either case you would want to set the application isolation to "High"

Hit your web site directly with a browser, then in VS 2008 use Debug->Attach to Process. You need to attach to a process with the name "DLLHOST.EXE". There will be more than one but most likely only one of them will contain the word "Script" in the Type column and thats the one you want. Make sure the "Attach to" box above the list of processes contains "Script".

Vista/Windows 7

Vista and Windows 7 will use IIS7 and that will allow you to create a new site if thats your preference. Make sure that the application has its own App Pool.

The procedure then is much the same except you are looking for W3WP.exe processes instead. If there are more than one that show "Script" in the type you can just attach to all of them.


With this in place you can set breakpoints, examine exceptions, and do all the normal stuff you could do with script debugging.


Use IIS for the server and Response.Write for the debugging. The way we did it "back in the day" ;)


Assuming you are running Windows XP with IIS installed and VS 2008 with the
default settings pref "General Developer Settings" you need to enable ASP
debugging in IIS:

Open Internet Information Server management console
Right click the "Default Web Site"
Left click "Properties"
Select the "Home Directory" tab
Left Click the "Configuration" button
Select the "Debugging" tab
Check both fags in the Debugging Flags section
Click Ok on all the dialogs until you are back to the management console
Close the management console

You now need to set permissions, you need to ensure that the IWAM user and the
IIS authenticated user have read access to the ASP file you want to debug.  I
find working as an administrator helps with permissions.  Note permissions will
probably be your biggest hurdle.

Now you need to edit your ASP page and place the word "Stop" in the code just
before where you want to debug, Note: you require to be logged into the Console
session in windows if you are using Remote Desktop.

Browse to the page in question and you shout be prompted to debug, you will then
choose what debugger you want to use, select VS2008, now you are debugging
Classic ASP.

Note:
This is from memory so if you have any trouble let me know, also VS2005 is
better for debugging Classic ASP.

I don't know if the Express editions will work with those instructions.

All asp pages have to be hosted in IIS.


Like AnthonyWJones said, you cannot debug non-ASP.Net code in Visual Studio development server.

However, if you have IIS 6.0 installed in your machine, you can use the Microsoft Script Debugger, which possibily will already be installed in your machine (mine has).

Here you can learn how to enable the IIS 6.0 to be debugged: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/3c7830b4-df5c-41a2-9890-c201eb774c89.mspx?mfr=true

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号