-
Notifications
You must be signed in to change notification settings - Fork 413
Description
Describe the bug
If you set the the package type in a class library, then the build adds the bootstrapper to the class library:
<WindowsPackageType>None</WindowsPackageType>This is because the condition to include the bootstrapper is very loose:
<PropertyGroup Condition="'$(WindowsAppSdkBootstrapInitialize)'=='' and '$(WindowsAppSDKSelfContained)'!='true' and '$(WindowsPackageType)'=='None'">A workaround is to also set the WindowsAppSdkBootstrapInitialize property:
<WindowsAppSdkBootstrapInitialize Condition=" '$(WindowsAppSdkBootstrapInitialize)' == '' and '$(OutputType)' != 'Exe' and '$(OutputType)' != 'WinExe' ">false</WindowsAppSdkBootstrapInitialize>Steps to reproduce the bug
- File | New | WinUI class library
- Set
WindowsPackageType=None - Build
- Inspect dll and observe bootstrapper
Expected behavior
No bootstrapper
Screenshots
No response
NuGet package version
1.0.0
Packaging type
No response
Windows version
No response
IDE
No response
Additional context
I noticed this when several libraries referenced each other:
C:\Users\mattl.nuget\packages\microsoft.windowsappsdk\1.0.2\include\MddBootstrapAutoInitializer.cs(11,38): warning CS0436: The type 'Release' in 'C:\Users\mattl.nuget\packages\microsoft.windowsappsdk\1.0.2\buildTransitive..\include\WindowsAppSDK-VersionInfo.cs' conflicts with the imported type 'Release' in 'SkiaSharp.Views.Maui.Controls, Version=2.88.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\mattl.nuget\packages\microsoft.windowsappsdk\1.0.2\buildTransitive..\include\WindowsAppSDK-VersionInfo.cs'. [C:\Projects\SkiaSharp\source\SkiaSharp.Views.Maui\SkiaSharp.Views.Maui.Controls.Compatibility\SkiaSharp.Views.Maui.Controls.Compatibility.csproj]