Thursday, July 8, 2010

Debugging Classic ASP With Visual Studio 2008 SP1 and 3.5 Framework

Thursday, April 30, 2009 06:22 | posted by: kevin

As much as I’d like never to debug complicated classic ASP code again, the fact is it’s everywhere in the enterprise today. Here is one way that I have found to speed up the process of supporting classic ASP w/ VS 2008 SP1/3.5.

At the last User Group meeting, I presented the features in the VS08 SP1 and 3.5 Framework. One topic/feature was only lightly covered in the documentation, but really jumped out at me, was that with Visual Studio 2008 SP 1 and 3.5 Framework VS 2008 can debug classic ASP code (script). I tried to find more information online, but the details were hard to find.So after a bit of research and trial and error I am sharing what I learned with you!

Here’s How:

1. Allow Server Side Debugging inside IIS Manager for the web site.

IIS Manager Settings

2. Open the Web Site in VS 2008 IDE by File - Open - Web Site and browsing to the directory that the IIS’s web is pointed to.

Open Web Site

3. Accept FrameworkUpgrade Warning (if prompted).

Framework Upgrade Warning

4. Configure Web Site Startup Properties to open correct website through IIS url (http://localhost/…)

Web Site Properties

5. Run Web Site in Debug Mode (F5) and accept Web.Config warning.

Allow .NET Debugging

6. In VS 2008 IDE Debug Menu select Attach To Process and choose the dllhost.exe process

Attach to dllhost.exe process

7. Begin Debugging By Setting Breakpoints in the IDE.

Visual Studio 2008 Debugging

That’s is !!! Ok so what changes were made to the original process?

When you exit the it VS 08 will prompt you to save a solution file.

And… A web.config for the .NET Debugger will be created in the root of the web. You should remove it when you deploy to production.

No comments: