unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.81k stars 708 forks source link

Cannot generate WinUI package "The target "_GenerateAppxPackage" does not exist in the project." #16935

Closed xperiandri closed 4 months ago

xperiandri commented 4 months ago

Current behavior

Windows package generation does not work

Expected behavior

Windows package generation works

How to reproduce it (as minimally and precisely as possible)

    <AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
    <PackageCertificateThumbprint>B5B28DB76EE9A662DB7345D00510D039ABFE348E</PackageCertificateThumbprint>
    <AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
    <AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
    <AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
    <GenerateTestArtifacts>True</GenerateTestArtifacts>
    <AppxBundle>Never</AppxBundle>
    <AppxBundlePlatforms>neutral</AppxBundlePlatforms>
    <HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>

Workaround

No

Works on UWP/WinUI

No

Environment

Other

NuGet package version(s)

5.2.139

Affected platforms

Windows (WinAppSDK)

IDE

Visual Studio 2022

IDE version

17.10.1

Relevant plugins

No response

Anything else we need to know?

No response

agneszitte commented 4 months ago

Hi @xperiandri did you already check the details in the documentation here https://platform.uno/docs/articles/uno-publishing-windows-packaged-signed.html ? (More documentation is coming soon for the other platforms: https://github.com/unoplatform/uno/pull/16903)

jeromelaban commented 4 months ago

Thanks @agneszitte. @xperiandri, the command line is the preferred way to generated packages so far. If you can check the documentation above, let us know if this helps.

xperiandri commented 4 months ago

2-step build works. Thank you very much! You just have a wrong second-step value https://platform.uno/docs/articles/uno-publishing-windows-packaged-signed.html#considerations-for-solutions-with-class-library-projects

as it has fewer parameters than https://platform.uno/docs/articles/uno-publishing-windows-packaged-signed.html#package-signed-the-app

Also, the format of displaying is readable badly image

agneszitte commented 4 months ago

2-step build works. Thank you very much! You just have a wrong second-step value platform.uno/docs/articles/uno-publishing-windows-packaged-signed.html#considerations-for-solutions-with-class-library-projects

as it has fewer parameters than platform.uno/docs/articles/uno-publishing-windows-packaged-signed.html#package-signed-the-app

Also, the format of displaying is readable badly

@xperiandri, thank you for your input! We'd love to help improve the documentation, but we need a bit more information to fully understand your concerns.

Could you please provide more details or perhaps a Before/After example of what you would like to see? This would be incredibly helpful for us to make the necessary improvements.

Additionally, regarding the format display in the code snippet area, do you mean that it is difficult to view because you need to scroll to see the rest of the content? Or do you mean something else here?

Thank you a lot in advance for your feedback!

xperiandri commented 4 months ago

thank you for your input! We'd love to help improve the documentation, but we need a bit more information to fully understand your concerns.

This comes from Package signed the app msbuild /r /p:TargetFramework=net8.0-windows10.0.19041 /p:Configuration=Release /p:Platform=x64 /p:GenerateAppxPackageOnBuild=true /p:AppxBundle=Never /p:UapAppxPackageBuildMode=Sideloading /p:AppxPackageDir="C:/temp/output/" /p:AppxPackageSigningEnabled=true

This comes from Considerations for solutions with class library projects msbuild /p:TargetFramework=net8.0-windows10.0.19041 /p:Configuration=Release /p:Platform=x64 /p:PublishSignedPackage=true /p:AppxPackageDir="C:/temp/output/"

The second option is incomplete and wrong. The only difference must be presence or absence of /r key

xperiandri commented 4 months ago

Additionally, regarding the format display in the code snippet area, do you mean that it is difficult to view because you need to scroll to see the rest of the content?

Yes, scrolling is inconvinient