Open kanglinqian opened 1 year ago
@kanglinqian Thanks for reporting this. The packaging and publishing feature is provided by Visual Studio. Please enter an issue here: https://developercommunity.visualstudio.com/VisualStudio/report?
@Scottj1s We looked into this issue from the Visual Studio side and determined that the problem is in the WinUI targets. Take a look at the "GenerateMsixPackage" target in Microsoft.Build.Msix.Packaging.targets, this does everything that's needed to write the file VS uses when clicking the "Copy and Close" button. The problem is that the condition on the target is never true:
Condition="'$(_GenerateMsixPackage)'=='true' "
I confirmed that if I perform the repro steps listed above with the small addition of setting the _GenerateMsixPackage property in my project file to true this scenario works, all the necessary app installer files are copied.
Please re-open this issue. cc @evelynwu-msft
@MSLukeWest We set _GenerateMsixPackage
to true
only if either GenerateAppxPackageOnBuild
or PublishAppxPackage
are true (I think the original expectation was that the latter would be set by somebody?). What properties are set and target invoked by VS when it goes through this workflow?
@evelynwu-msft The equivalent condition in the VS Appx targets is just 'AppxPackage==true', which should be the case for all packageable projects. I confirmed this is set to true for WinUI projects.
Got it. Looking over the .targets it appears that the semantics we've assigned to AppxPackage
aren't quite the same as what VS has assigned. Specifically, we don't use AppxPackage
as the primary knob for enabling packaging.
@Scottj1s I'm reopening this issue.
Adding an additional note, after noticing that this almost works for MAUI projects. In that scenario the _GenerateMsixPackage property is true, and the package, cert and dependencies all get copied to the app installer folder, but it's missing two files at the root:
So, I imagine that if a WinAppSDK fix is made that fixes the issue I describe above, there will still be this problem where the appinstaller file and index.html aren't present.
Describe the bug
Actual behavior: Installer location (e.g.: C:\Users\xxx\Desktop\Test) is empty.
Steps to reproduce the bug
Environment: Affected Branch: main Affected Build: 33201.295
Steps to reproduce:
Expected behavior
Installer location (e.g.: C:\Users\xxx\Desktop\Test) should contain created packages.
Screenshots
No response
NuGet package version
None
Windows version
No response
Additional context
No response