Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Whenever I try to open a classic asp page while running the site in VS2008 I get the error: "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

like image 795
Kenneth J Avatar asked Nov 20 '09 22:11

Kenneth J


People also ask

How do I debug in Visual Studio 2008?

On the development computer, open the Visual Studio project to debug and in its Properties, go in Debugging and select Remote Windows Debugger as the Debugger to launch, put something similar to C:\Share\$(ProjectName).exe in Remote Command, C:\Share in Working Directory, the server name indicated on the Visual Studio ...

How do I open classic ASP project in Visual Studio?

Create a new solution in Visual Studio and then, in the Solution Explorer window, right-click and select Add -> “Existing Project…” (or Add -> “New Project…”) for each project in your solution.


2 Answers

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.

like image 95
AnthonyWJones Avatar answered Oct 22 '22 23:10

AnthonyWJones


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

like image 31
John Sheehan Avatar answered Oct 22 '22 22:10

John Sheehan