ASP.NET 2.0 does great things but like its ancestors also has holes: things we need to do but can't -- or can't without dodging around it with inside knowledge, JScript and other tricks. AspNet2Holes is about those holes and the ways to step around them.

Monday, February 19, 2007

Debug-heaven in Server 2003 Web Edition

Users of Visual Studio 2005 and Internet Information Services 6.0 will probably discover that the Visual Studio tools cannot be used to build a Web site via a network link to Windows Server 2003 Web Edition, because these tools require more network connections than the Web Edition server will provide. At first glance this limitation appears to prevent remote debugging of an ASP.NET 2.0 Web Forms application that is running on a Web Edition server under IIS 6.0.

However, Microsoft provides Visual Web Developer 2005 Express as a free download. Installing this tool on the server and building on the server, with debug enabled, generates a Web site that can be opened via a network share in Visual Studio 2005 Professional or Team Edition. The Express tool is also useful to verify that a site will behave properly when it runs in a production user account environment.

Visual Studio 2005 Professional or Team Edition can use the Visual Studio 2005 Remote Debugger service installed with the Express tool, attaching an IIS 6.0 process. A developer will then be able to set breakpoints and debug code normally. Running under IIS 6.0, properties of the Environment class may be different from those found when running under a built-in Visual tool debugging server. When a rebuild is needed, the Express tool must be used to do it, and the site should not be open in both Express and Pro tools at the same time.

To use this approach, create Administrator accounts with the same name and password on both the development machine and the server. Also visit the Visual Studio 2005 Remote Debugger service properties, enable and start the service, and specify the developer's user account under the Log On tab. While debugging under IIS 6.0, the worker process is stopped whenever the code is on break. That causes any other session or Web site in the same IIS 6.0 application pool to stop.

About Me

Craig BolonCommercial software development over 25 years in Windows and Linux, before that in DOS, Unix, VMS and several others, more than 20 languages. Working now mostly in ASP.NET with C#, SQL and JavaScript.
View my complete profile