1

I'm working on a C# Code that has as Targeted Framework .NET 4.6, and I'm trying to troubleshoot some issues that occurs during the execution. That code is running on some clients, that has a .NET 3.5 Version. My question is, does .NET 4.6 supports retro-compatibility, and if so, should it be wiser to have an aligned Framework versions (Target Version same as Client Version)??

Guru Stron
  • 102,774
  • 10
  • 95
  • 132

3 Answers3

3

TL;DR: Basically, you can run old on new, but not new on old.


DotNet 4.6+ is backwards compatible in the sense, that you can run an App built with DotNet 3.5 etc. But you cannot run an app built with DotNet 4.6+ while using an older installed framework eg. 3.5 or others. Take it this way:

Imagine you have a windows 10 computer and you want to install an app built for windows 8 or even XP and older. Modern windows has the compatibility layers, necessary to run or install the program.

Now what you/your clients are doing is basically taking an app specifically designed for windows 10, and trying to run it on Windows XP or 95 etc. That won't work as the compatibility layers are not in place to support the "future". No one can foresee the new features and API's that they might add, so the app is incompatible with older Windows.


If you are targeting .NET 4.6, then target .NET 4.6.

Do not expect your code/app to be compatible with anything lower, and if you do need it to be, you have to target that specific version. Which has its own draw-backs as the newer methods / ways of doing things and many libraries you could be using do not apply/are not compatible.

You can either update everything to use 4.6 or higher, or switch your codebase to target 3.5 and live with the drawbacks.

SimpleCoder
  • 474
  • 4
  • 18
1

From Backward Compatibility

The .NET Framework 4.5 and later versions are backward-compatible with apps that were built with earlier versions of the .NET Framework. In other words, apps and components built with previous versions will work without modification on the .NET Framework 4.5 and later versions.

In your case app is built on .Net Framework 4.6 and the platform on client machine is 3.5 version. There might be some issues because app requires newer version than platform it runs.

kgzdev
  • 2,770
  • 2
  • 18
  • 35
1

.NET Framework version 4.6 was included with Windows 10 from version 1507 and .NET Framework version 4.6.2 was included with Windows Server 2016. If your clients are running either of these versions of Windows or newer, you won't have to install anything to run your .NET Framework 4.6 app, and it won't be running on .NET Framework 3.5 even if you do have it installed.

If you're using an older version of Windows than that and don't have .NET Framework 4.6 or newer installed, I wouldn't expect it to run at all.

madmonk46
  • 421
  • 3
  • 10