microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.79k stars 319 forks source link

Cryptic errors when WindowsPackageType is set to none. #2671

Open dhoehna opened 2 years ago

dhoehna commented 2 years ago

Describe the bug

In Using the bootsrapper in a non-MSIX package the recommendation is to set WindowsPackageType to none.

VS throws two cryptic errors

  1. "Visual C++ 2015-2019 Runtime for Universal Windows Platform Apps v14.0" which targets platform "UAP"
  2. Project "AppLifeCycleTest" targets platform "Windows", but references SDK "Visual C++ 2015-2019 UWP Desktop Runtime for native apps v14.0" which targets platform "UAP"

The solution to remove these errors is to Include <WinUISDKReferences>false</WinUISDKReferences> in the .*proj file.

Steps to reproduce the bug

  1. Make a non-MSIX project that uses Windows App SDK.
  2. Add <WindowsPackageType>None</WindowsPackageType> to the project file.

Expected behavior

No errors.

Screenshots

No response

NuGet package version

No response

Packaging type

No response

Windows version

No response

IDE

Visual Studio 2022

Additional context

No response

dhoehna commented 2 years ago

IDE: VS 2022 Enterprise Project: C++ Console application.

I didn't test this with a C# application, or different versions of Visual Studio.