The Gateway

.Net 4.0 and you

by Andy on May.03, 2010, under General

The recently released Visual Studio 2010 includes the new .Net runtime 4.0 with a hand full of new features, including the official release of F#, our new functional .Net friend! Finally! Besides that, the new Visual Studio got a new, much better layout and few new options, like code metrics, a nice achievement system for the MMO-developer. Being a Visual Basic Developer of the first hour (okay not the first I must admit, but for quite some time now) I’m especially happy about some pure syntax improvements, like getting rid of that ugly “_” char for splitting lines.

Okay now let’s start with the fun. Opening up the first Visual Studio 2008 solution will show us a small converting box, but all goes well. The problems start once you click on the compile button. You will probably either get compile errors, runtime exceptions or a hanging application if using a library which was not compiled against the new CLR v4. Like Managed DirectX in my case.

That’s because of the side-by-side feature of the new CLR, allowing multiple runtimes in one app. Something the older runtimes can’t handle. Lucky, there is a switch with the elegant name of useLegacyV2RuntimeActivationPolicy that should allow your older dlls to load fine. But be aware that it also disables the side-by-side feature for those legacy libraries. Don’t turn it on ‘just in case’! Try to avoid it and upgrade your libraries if possible.

It’s too early for me to write a complete review for Visual Studio 2010 and .Net 4.0, but I will post here if I should stumble across something. Happy coding!

Tags:, ,

Leave a Reply