Will the assembly compiled in the old version of .NET working in the new version of .NET change the behavior?

I have an assembly compiled with .NET 3.5. I cannot recompile it in .NET 4.5, as it is used in other applications that still run .NET 3.5. When I use assembly in my applications running .NET 4.5, will the assembly be processed as if it were running in .NET 4.5 instead of .NET 3.5? I have a WinForms application and a WebForms application as in .NET 4.5. If there is a change in behavior between .NET 3.5 and .NET 4.5, does the assembly return 4.5 results?

+4
source share
1 answer

Usually .Net infrastructure is backward compatible, therefore, the build developed in .Net 3.5 should not be a problem in version 4.5.

You should see: Version Compatibility in the .NET Framework

The .NET Framework 4.5 is backward compatible with applications that were built with the .NET Framework versions 1.1, 2.0, 3.0, 3.5, and 4. In other words, applications and components created using previous versions of the .NET Framework will work with the .NET Framework 4.5.

But there may be problems similar to those discussed in the article:

However, in practice, this compatibility may be violated by seemingly minor changes in the .NET Framework and changes in programming methods. For example, a performance improvement in the .NET Framework 4 may reveal race conditions that did not occur in earlier versions. Similarly, using a hard-coded path to the .NET Framework assemblies that perform equality comparison with a specific version of the .NET Framework and obtain the value of a private field using reflection are not compatible with the inverse methods. In addition, each version of the .NET Framework includes bug fixes and security related issues that may affect the compatibility of some applications and components.

The best way for you is to make sure your test cases pass after enabling dll from 3.5.

+5
source

Source: https://habr.com/ru/post/1479149/


All Articles