Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Breaking changes in .NET 4.0

Tags:

c#

.net-4.0

People also ask

Does installing .NET 4.0 will affect existing .NET applications running on previous versions?

No, they can exist alongside eachother. Just like with previous versions. In fact, 4.0 uses completely different directories to store its assemblies in. Uninstalling will prevent you from using older programs.

Is .NET 4.0 still supported?

As previously announced, starting January 12, 2016 Microsoft will no longer provide security updates, technical support or hotfixes for . NET 4, 4.5, and 4.5. 1 frameworks. All other framework versions, including 3.5, 4.5.

Is .NET being phased out?

It is not dead, and it will not be in the foreseeable future. The . NET Core updates may have distressed many developers. They may not be able to use the major functions of the original platform due to significant modifications made by unifying the .

Is Microsoft stopping supporting .NET Framework?

Support for . NET Framework versions 4.5. 2, 4.6, and 4.6. 1 ended on April 26, 2022, so security fixes, updates, and technical support for these versions will no longer be provided.


The languages documentation team publishes separate documents for C# and VB breaking changes:

VB: http://msdn.microsoft.com/en-us/library/cc714070%28VS.100%29.aspx

C#: http://msdn.microsoft.com/en-us/library/ee855831%28VS.100%29.aspx

I wrote the C# one and included covariance and contravariance breaking changes mentioned by Eric Lippert, and events changes discussed by Chris Burrows. There are also some breaking changes around optional parameters, embedded interop types, and method group type inference.

Update:

One more useful document (from .NET documentation team): http://msdn.microsoft.com/en-us/library/ee941656%28VS.100%29.aspx


Covariant and contravariant conversions introduce some obscure but possible breaking changes upon recompilation:

http://blogs.msdn.com/ericlippert/archive/2007/11/02/covariance-and-contravariance-in-c-part-nine-breaking-changes.aspx

The C# user education team compiles a list of the known potential breaking changes in the new version of the compiler, see the answer above for details.


Also note that SmtpClient now implements IDisposable so you should now use something like this:

using (var smtpclient = new SmtpClient())
{
  smtpclient.Send(message);
} 

According to this page there might be more of these 'hidden jams' inside the .NET 4.0 framework. And the author suggest to find them by using FxCop on your code.


Just to add to the list, here's the ASP.Net official list for the RC, I haven't come across an RTM one yet.