UserMat
UserMat

Reputation: 616

Common .Net Framework between Windows 7, Windows 8.1 and Windows 10

I'm developing a C# Windows Form Application. It is a "Hello World" application and doesn't need any special library so I'm not force to use any special .Net Framework version. But the most important thing for me is running the application on all Windows versions without needing to install or active .Net Framework. I want to run this application on Windows 10, Windows 8.1 and Windows 7. Is there any common preinstalled .Net framework version on these kind of Windows? For example .Net Framework 4.6 is surely preinstalled on Windows 10 but not on the Windows 7. Or .Net Framework 3.5 is Preinstalled on Windows 7 but no on the Windows 10 and my Application uses .Net Framework 4.5

Upvotes: 1

Views: 284

Answers (1)

Chikara
Chikara

Reputation: 72

AFAIK you have two options. Both have their problems.

Option 1

This article states that .NET Framework 4.5 and newer is backwards compatible with all previous versions, but there is a catch:

In practice, this compatibility can be broken by seemingly inconsequential changes in the .NET Framework and changes in programming techniques. For example, performance improvements in the .NET Framework 4.5 can expose a race condition that did not occur on earlier versions. Similarly, using a hard-coded path to .NET Framework assemblies, performing an equality comparison with a particular version of the .NET Framework, and getting the value of a private field by using reflection are not backward-compatible practices. In addition, each version of the .NET Framework includes bug fixes and security-related changes that can affect the compatibility of some apps and components.

Messy stuff.

If you go this route I would recommend testing your application on fresh installs of all (major - 7, 8, 8.1, 10) versions of Windows you want to deploy to. You would have to do this for every release, and make sure you manually get around to test all features. I would not recommend this route if you are doing any more than just trying out a Hello World application.

Option 2

Windows Forms has been ported to .NET Core since version 3.0, however the Windows Forms designer is not fully implemented yet.

Using .NET Core 3.x you can deploy a self contained application as described here, that will run on all versions of Windows.

Upvotes: 1

Related Questions