Allow the use of .NET Core 10#4331
Conversation
|
Two issues revealed by CI testing:
|
|
For the purposes of Toga, we should totally switch to .NET 10 IMHO. .NET 10 WinForms have out-of-the-box Dark Mode support, and more WinForms improvements. Not familiar with the compatibility issues... however just giing my opinion on whether to switch to .NET. 10 instead of using older .NET. |
|
The biggest compatibility issue is "Windows doesn't ship with .NET Core", so most users will run a Toga app and then get an error. It's not a hard error to fix... unless you don't have admin rights to install new software - and a lot of Toga users won't be. |
|
@freakboy3742 Hmm... is it possible to bundle .NET Core with your application, then? This may need a PR to the Visual Studio template. |
|
@freakboy3742 FYI: We should update to ContextMenuStrip anyways regardless of .NET 10 support status — which is available even in .NET 4.0. ContextMenu class is already flagged as "binary compatibility only" in docs: https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.contextmenu?view=windowsdesktop-10.0 — and it appears that MS has finally pulled the plug and removed it in .NET 10. But also, since Winforms context menus aren't very native-looking as seen in the DetailedList PR, might as well get Oliver-Leigh to win32 everything for context menus and menustrips. |
Not entirely: there was an option to pay for 1 year of extended support, and several ways to get it for free (I did, on my old laptop which wasn't Win11 compatible), and it looks like this will continue until 2028. |
@johnzhou721 This is actually on my to-do list... |
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Malcolm Smith <smith@chaquo.com>
|
FWIW: My earlier remark re: ContextMenu and/or other menu classes being deprecated in .NET Framework 3.1 was incorrect. It was deprecated in .NET Core 3.1, and although ContextMenuStrip etc. exists in .NET Framework 3.1 as well, it's less native, so the current approach of if-elsing .NETfx and .NETCore works, as it will allow .NET framework menus to become more native before the slightly mysterious Oliver-Leigh comes and Win32s everything. |
Allows the Winforms backend to use .NET Core 10, instead of .NET Framework 4.x.
This is required to add native Windows on ARM support - Windows 10 and 11 both provide .NET Framework 4.x (aka netfx) out of the box, but on ARM machines, it's an x86-64 build.
This adds in a loader configuration that will try to use .NET Core 10; if .NET 10 can't be found, it will try to fall back on .NET Framework 4.x. When running on ARM with a native ARM Python interpreter, this fallback will fail, so an error is raised.
In addition to the .NET loading changes, the changes in this PR are:
py3-none-win_arm64andpy3-none-win_amd64binary wheels.With the changes in this PR, the testbed passes to completion in my test environment with a small number of errors related to discrepancies caused by the virtualisation environment (discrepancies between
\\drive\locationandz:\locationpath descriptions).However, the testbed doesn't pass using the
windows-11-armenvironment, as that runner is configured as a non-interactive/headless environment. This means that no window ever gains focus, and we have no ability to test focus changes, dialog display, etc. See actions/partner-runner-images#174 for details.So - this PR does a full CI pass on both .NET Framework 4.x and .NET Core 10 on Windows/x86-64, validating that the .NET Core APIs work; but only does a basic "does the app start?" test for Windows/ARM64.
Two design decisions implicit in this PR:
However, my read is that Windows users are the least likely to be on the "bleeding edge" when it comes to new tech - we still get requests for restoring Windows 7/8 support - so dropping Windows 10 (even though it is EOL) is probably not a good idea quite yet.
Support for Windows/ARM64 has been merged into Briefcase; I've manually published stub binaries for Python 3.12 so that
briefcase runworks. See beeware/briefcase-windows-VisualStudio-template#89 for some template tweaks that are needed to tag those binaries.Fixes #2782.
PR Checklist: