Connecting Visual Studio to IE6 in a Virtual Machine

So, you’re developing web applications using Visual Studio and you’re a good boy or girl and are making sure you’re code is cross-browser compatible (as well as standards compliant of course, right, riiight?). We’ll it gets tricky right. You want to check Firefox, Chrome, Safari, Opera (for the 5 people that use it ;P), IE8, IE7, IE6, etc…and then all of that on PC/MAC (you could even check on linux, but come on really, who has that kind of time.) Well, you start installing browsers, and all goes well until you hit IE6.

Actually you probably thought to yourself that you might want a couple different versions of Firefox: you can do that with the Firefox portable versions and by following the directions here to modify firefox to allow multiple instances. For Safari and Opera on PC you can look at Browserseal.BrowserPack. On MAC you can check Michel Fortin’s site where he has packaged different versions of Safari and documented the process. IE8 allows you to switch between IE8 rendering and IE7, but not IE6. BrowserPack allows you to install all three versions of IE, but they are not native. I prefer to use a Windows XP mode Virtual PC with IE6 on my Windows 7 (64-bit) machine. This is well documented elsewhere (including how to get it to run on Win 7 Home).

Now you may or may not be aware that the web server built in to Visual Studio will not allow you to connect to it from another machine (which it considers the Virtual PC to be). So we have to configure a different server to test our project on. We could use IIS (which I found to be ridiculously finicky to set up, although I did get it working), but there is an easier, free way: Cassini Web Server.

It couldn’t be much simpler. Give your site a name, generate an ID for it with the button, and enter the physical path to the project files. Click save and you are done. Now this can be accessed by the virtual machine (or any machine that has access to yours) by the machine name: and the port assigned by Cassini or you.

There is one caveat and that is that if you’re project is strictly a 32-bit application Cassini (when installed on a 64-bit machine) will return an error. But if you go to this forum post on the Cassini website and ask for the 32-bit .exe (you will have to log-in) they will not only gladly email them to you, but also give you code samples on how to programmatically switch between the two different .exes as required by your project. I am only doing front-end development so I have chosen to change them manually for now.

I hope that helps someone.

Cheers,
Andre

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>