I want IE7 but I want to test my VS.NET 2003 applications on IE 5.5 - fiddly but can be done

I bit the bullet and installed IE 7 on my main development machine (Windows XP SP2). I had held back due to the fact that one of my main clients has an Intranet web application running under IE 5.5 / IE 6.0 and I need to develop against that as the benchmark standard.

Thanks to the wonderful Multiple IE installer I quickly had IE 3.0, IE 4.01, IE 5.01, IE 5.5 and IE 6.0 all available for testing my ASP.NET application.

The only tricky bit was getting Visual Studio 2003 to run the ASP.NET application not in IE 7 but in IE 6.0.  In the project properties dialog (right click on the project, select Properties), Configuration Properties/Debugging section, you change the Start Action as follows;

  1. Highlight the Start URL, and copy it to the Command Line Arguments setting.
  2. Change the Debug Mode from URL to Program. (click on Apply immediately to allow step 3)
  3. Set the Start Application to be IE 5.5 at C:\Program Files\MultipleIEs\IE55\IEXPLORE.EXE where the Multiple IE installer had installed IE 5.5.
  4. Click OK to save the changes.

I assumed that would work, but I received an error that I could not debug as Visual Studio could not run the application specified. It turns out that this is due to having both .NET 1.1 and .NET 2.0 frameworks installed.  Visual Studio 2003 defaults to the most recent .NET framework when launching an external program and therefore cannot debug the application as on my PC the most recent framework version is .NET 2.0.

Thanks to Monica Boris's blog it was quickly solved; you need to add an .NET configuration file iexplore.exe.config to the directory C:\Program Files\MultipleIEs\IE55 with the entries from the blog to specify the use of the .NET 1.1 framework.

Now I can quickly change the target browser version in my project properties dialog, or if I'm really brave, go back to URL debugging and run under IE 7.

UPDATE: 30 May 2007, 4.51PM BST

Ah well, when debugging when using Debug Mode set to Program I didn't have support for breakpoints in the code. You only get that when debugging by URL. So here are the steps to set Debug Mode to URL but debug via a specified browser;

  1. In project properties, change the Debug Mode to URL.  Set the start page as required.
  2. In Visual Studio, in Solution Explorer, right click an ASPX page from your project, say Default.aspx, right click and select Browse With.
  3. In the dialog, click on the Add button and browse to your desired browser, i.e. D:\Program Files\MultipleIEs\IE55\IEXPLORE.EXE.
  4. Highlight the new browser, listed as IEXPLORE.EXE, and click on the Set as Default button.

Now your default browser for URL debug mode is IE5.5.  You can easily click on Remove/Add browsers in the Browse With dialog as required depending on which version of IE you want to target.

Technorati tags: ,

Print | posted on Tuesday, May 29, 2007 11:17 PM

Comments on this post

No comments posted yet.

Your comment:

 (will show your gravatar)