How To Debug a Visual Studio 7 Beta 1 VB.NET Web Application

 

[This material was first submitted to aspngvs@ls.asplists.com]

 

Note: This outline assumes that on your machine you have installed Windows 2000, Visual Studio 6 (with Service Pack 4) followed by an installation of Visual Studio .NET 7 Beta 1.

 

--------------------------------------------------------------------------------------------

Something that works in my environment:

I still have some problems debugging vb.net Web Applications.  The naïve approach results in a vs7 beta 1 error message: "Unable to automatically attach to http://localhost/../default.aspx ...  Make sure you are a member of the 'Debugger Users' group on the server ..."

 

(I and everyone else I know is already a member of 'Debugger Users'!)

 

The problem is compounded by the presently incomplete state of the documentation. I found one helpful page in MSDN VS.NET: "Considerations in Debugging Different Project Types".

 

On my system the following work-around can be used to by-hand force vs7 beta 1 to debug a vb.net Web Application project.

 

1.    Build the solution that contains the Web App project.

2.    Make sure your Config.web file specifies <compilation
debugmode="true"/>.

3.    CLOSE the solution. This step may not be required but beta1 is slow and doing this seems to both speed-up debugging and provide a simpler environment.  In the following steps you may find it necessary to do some "tweaking" on your system.

4.    Debugging on a single machine the client process is IExplore.exe, the server process is xspwp.exe .  You must attach to xspwp.exe and may need to attach to IExplore.exe .

5.    Attaching to xspwp.exe :
From the vs7 debug menu:
- select 'processes'.
- check 'show system processes'
- highlight xspwp.exe and click 'Attach...'
- IMPORTANT: in the 'attach to process' dialog un-check all program types except 'common language runtime' then click 'Ok' ( I think there is another bug there.)
- since xspwp.exe is a system process, back in the processes dialog it might be a good idea to select "Detach from this process" in the 'when debugging is stopped' combo.

6.    Attaching to IExpore.exe:
- Sometimes IExplore.exe shows in the Processes dialog with Transport: set at "Default".  Sometimes IExplore.exe is running, but doesnt show: i dont know why (does anyone know why?). If you see it you may do a straight-forward attach to it.
- If Transport: set at "Default" does not show IExplore.exe: from your desktop Start menu run msvcmon.exe ("C:\Program Files\Microsoft Visual Studio.NET\Common7\Tools\Remote Debugger\msvcmon.exe"), change 'Transport:' to TCP/IP, 'Port:' to the IP address of your machine and you should now see IExplore.exe in the 'Avalable Processes' list. Do a straight-forward attach to it.

7.    Close the Processes dialog.

8.    In vs7 (for example) open the Default.vb file associated with your Default.aspx (I renamed WebForm1.aspx to Default.aspx, just to ensure I was not missing something) and set a breakpoint in Sub WebForm1_Load(). Point IExpore.exe to the url for your Default.aspx page, (for example: http:/localhost/Xxxx/Default.aspx) and 'Refresh' IExplore.exe. Your breakpoint should catch!

 

Rafael Pena

    rpenaphd@worldnet.att.net

1/20/2001

 

Keywords: HowTo, Walkthrough