Risks of the in-place upgrade

When .NET 4.5 is installed, it effectively replaces the existing .NET 4.0 assemblies in the machine; they are overwritten by a newer version.

Curiously, when we query the runtime version, Environment.Version is still 4.0.30319, having differences only in the build numbers. Basically, it becomes hard for the application to identify if we are running .NET 4.0 or 4.5, which might be necessary if we have to decide which part of the code can or cannot be executed.

And yes, we can build an application on .NET 4.5 and execute it on .NET 4.0, but these might not run properly if it uses some features of the .NET 4.5 framework. Otherwise, building .NET 4.0 applications with .NET 4.5 should not bring any problems.

For avoiding ...

Get Microsoft .NET Framework 4.5 Quickstart Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.