-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Hi!
We were advised by Microsoft Visual studio support to create this issue here. So, we hope that it is relevant to this repo. Please, let us know if not. The corresponding thread in DeveloperCommunity_VisualStudio can be found here.
###The essence
We’ve met this problem during the project (C#, WinForm) migration from .NET Framework 4.8.1
to .NET 9.0
.
Steps to see the problem:
- We’ve migrated the project, compiled it and tested its functionality. Here we’ve found out that we are now required to publish the app with the
.pubxml
profile to make a single and not self-contained.exe
instead of.exe-.dll-.json-.json
… whatever this supposed to be. - Using the publishing profile we’ve obtained the single-file executable that we’ve tested on Win10-x64 and Win7-x86. Both tests have been passed. The installation of .NET 9.0.4 desktop redistributables is not the problem for our aims. It is even better to not to “take” it with the executable.
- We’ve removed the .NET Framework project and added the .NET 9.0 project to the
.wapproj
dependencies without other changes. After this we get 3 warnings (fig. 1) about compatibility.
After that we can get two results:
- The builder can create a 100Mb bundle for 450Kb executable or (if single file option is enabled) 100Mb the-entire-OS-in-one-file executable. So, we literally can build package. But it will completely ruin the user (who downloads the app from Microsoft Store) experience. Not to mention that such an installation size is simply inadequate for the goals and objectives of the product.
- With another project (we've tried it too) the builder can refuse to build the code during to non-existing errors (like missing ‘using’ directive). Exactly the same code has been successfully built during the publishing process 10 seconds ago.
Our thoughts: there is some problem in the .wapproj
file and/or in the MSIX builder. Because all warnings and errors come from the step before zipping .MSIX
s into .appxbundle
.
How to reproduce directly:
- Use this project to build a single-file-exe: TestProject_NET9.zip. This is the partial copy of our actual product without our own sensitive assemblies. It’s free for testing (available on GitHub).
- Add the new WAP project (MSIX/APPX packaging project), connect the .NET 9.0 project to it. We can only provide our sample of
.wapproj
, without certificates and thumbprints, just to check its properties and verify its integrity: ScreenShooter_MSIX.zip. - Try to publish the bundle.
Tried workarounds:
- Creating new
.wapproj
: no effect - Clearing all building directories and caches: no effect
- Updating NuGets: no effect
Other notes:
Also when builder tries to do its work we can see about 900 warnings about possible compatibility problems for basic methods from System
, System.Windows.Forms
and other assemblies.
So, now we can still publish Android apps, APKs, Windows MSI packages, EXEs. But we cannot build apps for Microsoft Store. Which is not funny at all.
So, how can we fix it? We’ve lost 6 hours in search. But found nothing useful.
Thank you in advance,
RD AAOW FDL