Sunday, November 06, 2005

Visual Studio 2005 and Vista - Clearly a challenge

Anyone out there used Visual Studio 2005 RTM? Like it? So far I've been quite happy with it, except for an annoying little (minor) quirk where it likes to give the "green squiggly" to certain variables in "Finally" blocks.

How about on Vista? Have you tried to use VS 2005 there? Or perhaps just tried to run the compiled code on Vista? It didn't work, right? I've been fighting this annoyance with some code that I am working on that needs to work on both XP and Vista. Since Vista build 5231 is not very stable (OK, well the truth is not stable at all), I don't want to try to do the dev work on Vista. So I have been building on Windows XP, and debugging and testing on XP. Then I move the EXE over to Vista 5231 and it won't run. It turns out the runtime version of the RTM Visual Studio is v2.0.50727.42. The version on Vista build 5231 is v2.0.050727.20. So the EXE's just crash.

Not a problem, right? Just upgrade the runtime on Vista and it'll work like a champ. Not so fast... Microsoft has made the runtime part of the operating system. So the only way to upgrade it is via an OS Service Pack or patch. Nasty! So, what's a poor enterprising developer to do? Wait for a new build of Vista?

Not likely! What I've been doing is to install the RC of Visual Studio onto my Vista machines. It will run with the version of the runtime installed on 5231. Then, after coding and debugging on Windows XP, I copy the whole project over to the Vista machine and recompile it using the RC version of Visual Studio. So far I've only run into one code change I had to make in order to do that. Opening one of my projects and compiling it in the RC version gave an error on a line of code that the designer had created. The line was:

Me.lvItems.UseCompatibleStateImageBehavior = False

I was able to just rem that line out and the project worked in the RC version and could be tested on Vista.

Kind of a pain to do dev work and testing on both platforms at this point, but at least it is working for me. I can't wait for the next CTP build of Vista as it will be sure to have the RTM version of the runtime and I can quit using the compiler version shuffle to do testing.

No comments: