I was planning to upgrade WinForms applications from .NET Framework to .NET 6, but unfortunately trimming is disabled for Windows Forms and WPF applications in .NET 6. https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/incompatibilities. This rules out a stand-alone deployment since each install will now be well over 100MB (currently, my .NET Framework versions have a 2MB install). In .NET 5, with trimming still allowed for WinForms, this was less than 50MB, which may have been borderline acceptable, but I'd like to use .NET 6.
The framework-dependent build option unfortunately has the critical error message box "To run this application you must install .NET Desktop Runtime 6.0.0". The appearance of this message is sure to scare off a certain segment of potential customers (the critical error red x, etc.) from even bothering to install the trial/demo/free edition.
Is there another option? I'm using InnoSetup, so any option has to be compatible with this.
Update Oct 28 2022: I'm currently using a .NET 6 self-contained (but not single-file) install. I adjusted my custom build utility to remove the WPF assemblies which for some inexplicable reason are included by dotnet publish for WinForms builds. After removing the WPF assemblies, the compressed setup exe is large (38 MB), but acceptable. Someone needs to sharpen up this sloppy build output for WinForms (not sure if this would be Microsoft or some random person on github).
Update Nov 15 2022: The data transfer rates for users downloading the large self-contained builds were unacceptable, so back to .NET Framework again for now. Would like to do 'framework-dependent' builds, but the .NET Desktop Runtime does not install after answering 'yes' to the ugly prompt asking whether to download it. (The ugly prompt goes away after answering 'yes', but nothing else happens). How are others getting around this? I thought by now Microsoft would have had enough feedback to make this work.
Update Nov 16 2022: Now we're producing 'framework-dependent' builds, which are roughly the same size as the .NET Framework 4.8 builds. The ugly prompt to install .NET Desktop Runtime is not ideal and to get the prompt to actually work you have to use "PublishSingleFile=true" for some bizarre reason.
Update Jan 13 2023: Well, we upgraded to .NET 7 and after months of user complaints about install issues, we're back to building for .NET Framework 4.8. The reason for this is the bewildering choices Microsoft has made about .NET 7 framework-dependent applications. Users are now prompted separately for 2 different installs (Microsoft.NETCore.App and Microsoft.WindowsDesktop.App, in that order), even though the second includes the first! Users were confused and thinking they were being prompted for the same thing again, gave up on the install, thinking the install was broken. This can be reproduced by creating a .NET 7 WinForms application and then installing (I use Inno Setup) to a machine without .NET 7. You'll be prompted first for Microsoft.NETCore.App and after this install, attempting to run the application will result in yet another prompt for Microsoft.WindowsDesktop.App. So a .NET 7 desktop application will fail to run the first two times, prompting for .NET 7 installs, when just the second one would take care of it! I have to seriously wonder if Microsoft has enough people working on this.