I’m really excited about my new “What’s New in .NET 4.5” course on Pluralsight.
There’s more information in the course than I could stuff into my blog in a year, but I want to cover a few high points here. I wrote the course as “What I want every coder and manager to know about this release,” but I know you won’t all get a chance to watch it. So, I’ll cover what I can here, starting with a series of short posts with the most important point, or maybe two, in each of the eight modules.
Module 1 – Introduction
Yes, the introduction is more than an agenda slide J
As an in-place release, there are two versions of the .NET 4 libraries – no, wait three versions – and probably more in the future. That’s right, I said the .NET 4 libraries – it doesn’t matter whether your targeting .NET 4.0 or 4.5. I know that sounds a little crazy, but I’m afraid we’re going to have to get used to the craziness.
You probably don’t control the version of the .NET framework that’s running in production. Another application installation, or the user, or an operating system upgrade (Windows 8 or Server 2012), or at some future point Windows Update could upgrade a target computer to a new version of .NET 4 without you touching your deployed application in any way.
That should scare you, but it’s part of the brave new world. Microsoft is tooling itself for fast incremental releases, led by the fantastic advancements in the Azure space. There’s a good side of this and a bad side of this, and in the end I’m not sure it matters very much what I think.
So, you’ve got to learn about this release, whether or not you intend to target .NET 4.5 in the foreseeable future. And we need to ferret out ways for ongoing validation of our working systems – validated algorithms, in-place production testing, and widespread use of tracing (oh wait! that’s module 3 on ETW support).
I said there were three, versions of the .NET 4.0 framework in the wild – there are probably more with hot fixes, but these are the three you need to know about.
- .NET 4.0 released with VS 2010 (4.0.30319.1)
- .NET 4.5 released with VS 2012, regardless of target platform (4.0.30319.17929)
o Please don’t run this version this pre-January 2013 updates version if you can help it
o You may not be able to ensure your user’s install this recommended upgrade
o There’s a corresponding security update that is separate and required
- .NET 4.5 reliability (and security) update released January 8, 2013 (4.0.30319.18033)
If you’re not thoughtful, you may be testing against a different version of the framework than the one your users are running.
On a particular machine, you can determine whether the updates are installed through Windows Update history, the registry, or the version number on something like mscorlib.dll in the GAC (oh wait! that’s module 8 on breaking changes). You can also test for the existence of the type System.ReflectionContext if you want to know whether you’re working with a version above the VS 2010 libraries (4.0.30319.1). Test for a type, not a member (reflection considerations are in module 2 on the core framework changes) and not the specific version number, which might be fragile going forward.
There are at least four ways the new version of .NET will affect your code:
- When new libraries are installed in production (what I’m talking about in this post)
- When you recompile with the VS 2012 compilers (regardless of your target version)
- When you target .NET 4.5 for its awesome new features
- When you rerun custom tools
- When a computer you exchange data with upgrades libraries
The five point survival guide is test, test, test, test, test, test. And that’s regardless of when you plan to explicitly target .NET 4.5.
Overall .NET 4.5 is awesome and the compatibility of the new libraries is good. But, if your one of the unlucky ones that encounter a problem, the probabilities don’t matter at all.
Whether it’s through my course or other venues – if you’re responsible for production code, you really need to learn about .NET 4.5 and start considering how you’re going to accommodate the new fast moving cycles.