3
votes

Is there any other means to debug an ASP Classic application using Visual Studio?

Right now, I have a classic ASP application and I use the IIS 5 of WinXP. I debug the ASP application right now by attaching the DLLHOST.EXE from (Debug > Attach Process) in Visual Studio 2005.

This works fine except sometimes when debugging like this the line where I am debugging becomes misaligned. Also, It is becoming very tiresome to repeat the Tools Attach Process process over and over again.

I have an old Visual Studio 6.0 interdev, can it do the F5 style seamless debugging I can do in ASP .NET?

Actually what annoys me on debugging with Visual Studio 2005 is I need to attach the dllhost.exe each time I debug.

3
+1 its a good question, personally I've not found attaching to a DLLHOST all that burdensome but I guess its down to what you are used to. It would be nice F5 debug ASP despite its age.AnthonyWJones

3 Answers

3
votes

You can make a macro in VS2005 to do this.

http://blogs.msdn.com/jimgries/archive/2005/11/30/498264.aspx

Contains an example of attaching to the Calc process.

Sub AttachToCalc()
       Try

              Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
              Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
              Dim dbgeng(1) As EnvDTE80.Engine

              dbgeng(0) = trans.Engines.Item("Native")

              Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, "JIMSMACHINE").Item("calc.exe")

              proc2.Attach2(dbgeng)

       Catch ex As System.Exception
              MsgBox(ex.Message)
       End Try

End Sub
2
votes

I find it tedious as well to the point where I avoid doing it somewhat. However, try using only your keyboard to open the website and attach to the process, for me this makes it much less tedious.

If I remember correctly and for my environment... Alt+F E (open website) Enter Ctrl+Alt+P (Attach to process) D (to select DLL host) Enter Enter

1
votes

The only way to debug classic ASP in VS2005 and VS2008 is by attaching to the ASP worker process. However you can automate that with a macro so the whole ordeal is reduced to pressing a key combo. Here is an article with full working code on how to do that. It should work on any version of IIS.

http://blogs.msdn.com/greggm/archive/2006/03/15/552108.aspx