Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any difference between .NET 2 and .NET 4 assemblies running under .NET 4

I maintain a .NET 2.0 library and recently it's users started asking for a .NET 4 version.

I could just duplicate existing project in Visual Studio, set Target Framework to .NET Framework 4.0 and be done with it, but is there any difference between .NET 2 and .NET 4 assemblies running under .NET 4?

I mean, will it change anything if I just rebuild the same source code for .NET 4? Am I expected to have different set of unit test for .NET 2 and .NET 4 builds?

like image 451
Bobrovsky Avatar asked Oct 28 '25 10:10

Bobrovsky


1 Answers

.Net frameworks are backward compatible, so .Net framework 2.0 library should work fine on .Net framework 4.0. I am not sure why your library users are asking for .Net framework 4.0 library, because it doesn't make any difference to them.

However if you want to recompile your .Net 2.0 library to 4.0 then normally there shouldn't be any issues but you should see: Visual C# 2010 Breaking Changes

like image 50
Habib Avatar answered Oct 29 '25 23:10

Habib



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!