Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to WinAppSdk 1.6, enable AoT on gallery head #195

Merged
merged 27 commits into from
Aug 23, 2024
Merged

Conversation

Arlodotexe
Copy link
Member

This PR:

  • Updates our dependency on Microsoft.WindowsAppSdk to the latest 1.6
  • Enables AoT publishing for the WinAppSDK gallery head when building release
  • Updates msbuild props as needed for the above changes to build successfully

@Arlodotexe
Copy link
Member Author

Arlodotexe commented Jun 20, 2024

A local release/AoT build worked as expected the first time, but subsequent builds are giving this error message, even after a full and proper clean on the tooling repo:

17>0 IID calculations/fetches patched
13>0 IID calculations/fetches patched
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\CommunityToolkit.WinUI.Animations.AnimationDictionary.WinRTVtable.g.cs(21,13,21,60): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs(588,33,588,113): error CS0234: The type or namespace name 'List' does not exist in the namespace 'ABI.System.Collections.Generic' (are you missing an assembly reference?)
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs(1851,33,1851,61): error CS0234: The type or namespace name 'CommunityToolkit' does not exist in the namespace 'ABI' (are you missing an assembly reference?)
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(29,13,29,62): error CS0436: The type 'IReadOnlyList_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IReadOnlyList_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(35,13,35,60): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(125,13,125,60): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(179,29,179,76): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(198,29,198,76): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(217,29,217,76): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(242,13,242,62): error CS0436: The type 'IReadOnlyList_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IReadOnlyList_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(248,13,248,60): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(351,29,351,76): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(389,29,389,76): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(408,29,408,76): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(439,13,439,60): error CS0436: The type 'IEnumerator_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerator_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(483,29,483,76): error CS0436: The type 'IEnumerator_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerator_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(535,29,535,76): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(560,13,560,60): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(565,13,565,62): error CS0436: The type 'IReadOnlyList_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IReadOnlyList_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(671,13,671,60): error CS0436: The type 'IEnumerator_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerator_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(699,13,699,60): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(735,29,735,90): error CS0234: The type or namespace name 'List_Microsoft_UI_Xaml_UIElement' does not exist in the namespace 'WinRT.GenericHelpers' (are you missing an assembly reference?)
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(783,13,783,60): error CS0436: The type 'IEnumerable_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerable_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGlobalVtableLookup.g.cs(787,13,787,60): error CS0436: The type 'IEnumerator_object' in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs' conflicts with the imported type 'IEnumerator_object' in 'CommunityToolkit.WinUI.Extensions, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Users\arlog\source\repos\Windows\components\Animations\src\obj\Release\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs'.
19>Done building project "CommunityToolkit.WinUI.Animations.csproj" -- FAILED.

I wonder if this could be related to our troubles in CommunityToolkit/Windows#169, considering the latest insights from 8.1-rc 🤔

@Arlodotexe
Copy link
Member Author

Arlodotexe commented Jul 2, 2024

@michael-hawker Locally, I've removed all usages of InternalsVisibleTo and got a successful debug/release build with AoT turned off.

With AoT turned back on, we still get these errors:


       "C:\Users\arlog\source\uwp\lib\Windows\tooling\ProjectHeads\AllComponents\winappsdk\CommunityToolkit.App.WinAppSdk.csproj" (Clean;Build target) (1:7) ->        
       "C:\Users\arlog\source\uwp\lib\Windows\components\Animations\src\CommunityToolkit.WinUI.Animations.csproj" (default target) (5:52) ->
       (CoreCompile target) ->
         C:\Users\arlog\source\uwp\lib\Windows\components\Animations\src\obj\x64\Debug\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenera 
       tor\WinRTGlobalVtableLookup.g.cs(324,29): error CS0234: The type or namespace name 'List_Microsoft_UI_Xaml_UIElement' does not exist in the namespace 'WinRT.Ge 
       nericHelpers' (are you missing an assembly reference?) [C:\Users\arlog\source\uwp\lib\Windows\components\Animations\src\CommunityToolkit.WinUI.Animations.cspro 
       j::TargetFramework=net8.0-windows10.0.22621.0]
         C:\Users\arlog\source\uwp\lib\Windows\components\Animations\src\obj\x64\Debug\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenera 
       tor\WinRTGenericInstantiation.g.cs(588,33): error CS0234: The type or namespace name 'List' does not exist in the namespace 'ABI.System.Collections.Generic' (a 
       re you missing an assembly reference?) [C:\Users\arlog\source\uwp\lib\Windows\components\Animations\src\CommunityToolkit.WinUI.Animations.csproj::TargetFramewo 
       rk=net8.0-windows10.0.22621.0]
         C:\Users\arlog\source\uwp\lib\Windows\components\Animations\src\obj\x64\Debug\net8.0-windows10.0.22621.0\WinRT.SourceGenerator\Generator.WinRTAotSourceGenera 
       tor\WinRTGenericInstantiation.g.cs(1851,33): error CS0234: The type or namespace name 'CommunityToolkit' does not exist in the namespace 'ABI' (are you missing 
        an assembly reference?) [C:\Users\arlog\source\uwp\lib\Windows\components\Animations\src\CommunityToolkit.WinUI.Animations.csproj::TargetFramework=net8.0-wind 
       ows10.0.22621.0]

edit: work on InternalsVisibleTo pushed to CommunityToolkit/Windows#446 for review, no AoT enabled on this branch.

@Sergio0694
Copy link
Member

@Arlodotexe to double check, can you also try building against the latest CsWinRT build from the staging/AOT branch? You can just download the package from the artifacts (pick the latest commit from that branch) and setup a local feed for that.

Also cc. @manodasanW for those generator errors.

@manodasanW
Copy link

@Arlodotexe Can you set EmitCompilerGeneratedFiles in the csproj and share the generated files from the obj folder so I can see how the generated code corresponds with the errors.

@Arlodotexe
Copy link
Member Author

@Arlodotexe Can you set EmitCompilerGeneratedFiles in the csproj and share the generated files from the obj folder so I can see how the generated code corresponds with the errors.

Here are the requested files: Animations.obj.Debug.zip

@Arlodotexe
Copy link
Member Author

@Arlodotexe to double check, can you also try building against the latest CsWinRT build from the staging/AOT branch? You can just download the package from the artifacts (pick the latest commit from that branch) and setup a local feed for that.

Found the staging/AOT branch, but the DevOps feed is private.

@manodasanW
Copy link

Thanks @Arlodotexe All 3 errors look related to our KeyVauluePair bug (microsoft/CsWinRT#1638) which is fixed for our next preview release.

if (typeName == "System.Collections.Generic.KeyValuePair`2[Microsoft.UI.Xaml.UIElement,System.Collections.Generic.List`1[Microsoft.UI.Xaml.UIElement]]") { _ = global::WinRT.GenericHelpers.List_Microsoft_UI_Xaml_UIElement.Initialized;

@Arlodotexe
Copy link
Member Author

Thanks @manodasanW, looks like that solved our issues on the library projects!

The last remaining issue is on the app head:

51>C:\Users\arlog\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1560,5): error APPX1101: Payload contains two or more files with the same destination path 'WinRT.Runtime.dll'. Source files: 
51>C:\Users\arlog\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1560,5): error APPX1101: C:\Users\arlog\.nuget\packages\microsoft.windows.sdk.net.ref\10.0.22621.35-preview\lib\net6.0\WinRT.Runtime.dll
51>C:\Users\arlog\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1560,5): error APPX1101: C:\Users\arlog\.nuget\packages\microsoft.windows.cswinrt\2.1.0-prerelease-ci.240702.1\lib\net6.0\WinRT.Runtime.dll
51>Done building project "CommunityToolkit.App.WinAppSdk.csproj" -- FAILED.
========== Build: 50 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Seems like a packaging error, WinRT.Runtime.dll is being included by both Microsoft.Windows.CSWinRT and Microsoft.Windows.Sdk.Net.Ref.

@manodasanW
Copy link

Thanks @manodasanW, looks like that solved our issues on the library projects!

The last remaining issue is on the app head:

51>C:\Users\arlog\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1560,5): error APPX1101: Payload contains two or more files with the same destination path 'WinRT.Runtime.dll'. Source files: 
51>C:\Users\arlog\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1560,5): error APPX1101: C:\Users\arlog\.nuget\packages\microsoft.windows.sdk.net.ref\10.0.22621.35-preview\lib\net6.0\WinRT.Runtime.dll
51>C:\Users\arlog\.nuget\packages\microsoft.windowsappsdk\1.6.240531000-experimental1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1560,5): error APPX1101: C:\Users\arlog\.nuget\packages\microsoft.windows.cswinrt\2.1.0-prerelease-ci.240702.1\lib\net6.0\WinRT.Runtime.dll
51>Done building project "CommunityToolkit.App.WinAppSdk.csproj" -- FAILED.
========== Build: 50 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Seems like a packaging error, WinRT.Runtime.dll is being included by both Microsoft.Windows.CSWinRT and Microsoft.Windows.Sdk.Net.Ref.

I know we had a problem here we fixed with authoring WinRT components in C# that had this issue, but I don't think you are doing that here. In this scenario, .NET should have determined the newer version and picked that. I assume that CsWinRT package is from our feed that we had built in the pipeline right? I will probably need a binlog to investigate what is happening. Might want to also try clearing your bin / obj to see if that helps.

@Arlodotexe
Copy link
Member Author

Arlodotexe commented Jul 4, 2024

I assume that CsWinRT package is from our feed that we had built in the pipeline right?

That's correct @manodasanW, this is using CsWinRT 2.1.0-prerelease-ci.240702.1. Here's a debug binlog, built just after cleaning bin/obj: CommunityToolkit.App.WinAppSdk.msbuild.zip

@manodasanW
Copy link

@Arlodotexe Can you try out the preview we released yesterday.

CsWinRT 2.1.0-prerelease.240722.1
Windows SDK projection: 10.0.<sdk_ver>.37-preview

https://github.com/microsoft/CsWinRT/releases/tag/2.1.0-prerelease.240722.1

@michael-hawker
Copy link
Member

Kicking the failed job, probably CommunityToolkit/Windows#347 again?

@Arlodotexe
Copy link
Member Author

Arlodotexe commented Jul 31, 2024

Kicking the failed job, probably CommunityToolkit/Windows#347 again?

I'm working on fixing all the AoT annotations locally before I dig into that too much. Cause might be related.

@manodasanW
Copy link

@Arlodotexe I saw you had updated WindowsSdkPackageVersion to 38, you want to keep it on 37-preview until we address the type conflict issue in WinAppSDK. See my previous comment here. It is fine to increment the WinAppSDK version to preview1.

@Arlodotexe
Copy link
Member Author

I've got successful local builds with the latest changes, but CI in both CommunityToolkit/Windows#457 and CommunityToolkit/Labs-Windows#561 are throwing this:

55>C:\Users\runneradmin\.nuget\packages\microsoft.windowsappsdk\1.6.240807006-preview1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1616,5): error APPX1101: Payload contains two or more files with the same destination path 'WinRT.Runtime.dll'. Source files:  [C:\a\Windows\Windows\tooling\ProjectHeads\AllComponents\Tests.Wasdk\CommunityToolkit.Tests.Wasdk.csproj]
2024-08-16T18:38:50.0377208Z ##[error]C:\Users\runneradmin\.nuget\packages\microsoft.windowsappsdk\1.6.240807006-preview1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1616,5): error APPX1101: C:\Users\runneradmin\.nuget\packages\microsoft.windows.sdk.net.ref\10.0.22621.37-preview\lib\net6.0\WinRT.Runtime.dll 
2024-08-16T18:38:50.0382780Z ##[error]C:\Users\runneradmin\.nuget\packages\microsoft.windowsappsdk\1.6.240807006-preview1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1616,5): error APPX1101: C:\Users\runneradmin\.nuget\packages\microsoft.windows.cswinrt\2.1.1\lib\net8.0\WinRT.Runtime.dll 

We saw a similar error to this earlier, looks like our solution before was to update CsWinRT and the Windows SDK projection.

@manodasanW anything you could add to this?

@Arlodotexe
Copy link
Member Author

I've got successful local builds with the latest changes, but CI in both CommunityToolkit/Windows#457 and CommunityToolkit/Labs-Windows#561 are throwing this:

55>C:\Users\runneradmin\.nuget\packages\microsoft.windowsappsdk\1.6.240807006-preview1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1616,5): error APPX1101: Payload contains two or more files with the same destination path 'WinRT.Runtime.dll'. Source files:  [C:\a\Windows\Windows\tooling\ProjectHeads\AllComponents\Tests.Wasdk\CommunityToolkit.Tests.Wasdk.csproj]
2024-08-16T18:38:50.0377208Z ##[error]C:\Users\runneradmin\.nuget\packages\microsoft.windowsappsdk\1.6.240807006-preview1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1616,5): error APPX1101: C:\Users\runneradmin\.nuget\packages\microsoft.windows.sdk.net.ref\10.0.22621.37-preview\lib\net6.0\WinRT.Runtime.dll 
2024-08-16T18:38:50.0382780Z ##[error]C:\Users\runneradmin\.nuget\packages\microsoft.windowsappsdk\1.6.240807006-preview1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1616,5): error APPX1101: C:\Users\runneradmin\.nuget\packages\microsoft.windows.cswinrt\2.1.1\lib\net8.0\WinRT.Runtime.dll 

We saw a similar error to this earlier, looks like our solution before was to update CsWinRT and the Windows SDK projection.

@manodasanW anything you could add to this?

Ah, I think I see why the build error is happening in the CI but not locally. The error is on the test head, not the gallery head. That's odd because we don't have AoT enabled on our test head, it's just the update to Wasdk 1.6 🤔

@Arlodotexe
Copy link
Member Author

I've got successful local builds with the latest changes, but CI in both CommunityToolkit/Windows#457 and CommunityToolkit/Labs-Windows#561 are throwing this:

55>C:\Users\runneradmin\.nuget\packages\microsoft.windowsappsdk\1.6.240807006-preview1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1616,5): error APPX1101: Payload contains two or more files with the same destination path 'WinRT.Runtime.dll'. Source files:  [C:\a\Windows\Windows\tooling\ProjectHeads\AllComponents\Tests.Wasdk\CommunityToolkit.Tests.Wasdk.csproj]
2024-08-16T18:38:50.0377208Z ##[error]C:\Users\runneradmin\.nuget\packages\microsoft.windowsappsdk\1.6.240807006-preview1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1616,5): error APPX1101: C:\Users\runneradmin\.nuget\packages\microsoft.windows.sdk.net.ref\10.0.22621.37-preview\lib\net6.0\WinRT.Runtime.dll 
2024-08-16T18:38:50.0382780Z ##[error]C:\Users\runneradmin\.nuget\packages\microsoft.windowsappsdk\1.6.240807006-preview1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1616,5): error APPX1101: C:\Users\runneradmin\.nuget\packages\microsoft.windows.cswinrt\2.1.1\lib\net8.0\WinRT.Runtime.dll 

We saw a similar error to this earlier, looks like our solution before was to update CsWinRT and the Windows SDK projection.
@manodasanW anything you could add to this?

Ah, I think I see why the build error is happening in the CI but not locally. The error is on the test head, not the gallery head. That's odd because we don't have AoT enabled on our test head, it's just the update to Wasdk 1.6 🤔

Turning off AoT on the gallery yields the same error:
image

Copy link
Member

@Sergio0694 Sergio0694 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

MultiTarget/EnabledTargetFrameworks.props Show resolved Hide resolved
MultiTarget/PackageReferences/WinAppSdk.props Show resolved Hide resolved
MultiTarget/WinUI.Extra.props Show resolved Hide resolved
MultiTarget/WinUI.Extra.props Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants