Home > Net >  Will WPF .Net 6.0 Applications work on Windows 7 or Windows XP?
Will WPF .Net 6.0 Applications work on Windows 7 or Windows XP?

Time:12-09

I have to design a simple application to communication via serial ports with a machine and then record the responses in a excel file. The application needs to be able to work with window XP all the way up till windows 10. Is WPF .net 6.0 a good choice?

CodePudding user response:


OP:

Will WPF .Net 6.0 Applications work on Windows 7 or Windows XP?

TL;DR: hardware-based Windows Desktop acceleration is not available on XP so there is no point trying to deploy WPF on it irrespective of what version of .NET you are trying to use


Windows XP support has ended

OP:

...needs to be able to work with window XP all the way up till...

Unless you are working for a major government body, support for Windows XP has ended, so no.

WPF requires hardware acceleration

Also, given that you are wanting to create a WPF app, a technology released late 2006, one of the biggest selling points of WPF historically was that it was one of the first MS GUI frameworks to support hardware-acceleration (apps were blitted to the screen in a single operation via DirectX) - something that didn't appear in the Windows Desktop until Windows Vista in early 2007 (remember suddenly people were buying 3D cards just to run Windows).

Unfortunately, Windows XP, an operating system released in 2001 predates hardware acceleration in the Windows Desktop, so even if you managed to deploy a WPF app on XP, it is unlikely that it will be hardware-accelerated and will run poorly.

Additionally, WPF was originally released in .NET Framework 3 and required one of Windows Vista, Windows Server 2008 R2 SP1 .

What's the minimum for WPF?

You can use WPF on Windows Vista with .NET Framework 3.0 safe in the knowledge that it will benefit from hardware-acceleration.

What about the .NET 5 road?

Given that WPF in .NET 5 is Windows-only anyway (thus kinda defeating the mandate of cross-platform that is .NET Core/5 ) and the fact that more and more Windows-specific technologies are either being dropped or not ported in the first place to .NET 5 , you really need to ask yourself:

Question

  • If I know my app is only for Windows and I don't care about cross-platform, should I start to use .NET 5 ?

...to which the answer is a big "Be careful before signing up!".

The following technologies are not available in .NET 5 :

  • App Domains
  • CAS (including Security Transparency)
  • GAC

...which is a real shame since there are quite a few legacy WPF (and WinForms for that matter) Smart Client projects out there that require these technologies for bullet-proof extensivity and sandboxing of 3rd party plug-ins.

To me WPF .NET 5 is a bit of an unknown; it is unclear if it is hardware-accelerated and even if it is, do you want to risk such support being dropped in the future (in exactly the same way AppDomain.CreateDomain was dropped in .NET 6).

My advice would be to stick with .NET Framework 3.0 (.NET Framework 4.x would be better) if the intent is to create hardware-accelerated WPF apps.

CodePudding user response:

From what I see you will need to go back all the way to .NET Framework 4, if you really need to support XP. I have however never tested this, and you might still get it to work. If you only need Windows 7 and upwards, .NET 6 seems fine. The supported OS Versions of .NET Core can be found on GitHub. The supported Framework versions for each OS can be found in Microsofts Documentation.

Your specific needs seem to be serial port communication and excel file creation, both are compatible with .NET Framework 4.

You don't explain why you need a GUI, WPF will be a problem, but WinForms should be fine.

  • Related