Tooling-Windows-Submodule icon indicating copy to clipboard operation
Tooling-Windows-Submodule copied to clipboard

Update to WinAppSdk 1.6, enable AoT on gallery head

Open Arlodotexe opened this issue 1 year ago • 17 comments

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 avatar Jun 20 '24 05:06 Arlodotexe

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 https://github.com/CommunityToolkit/Windows/issues/169, considering the latest insights from 8.1-rc 🤔

Arlodotexe avatar Jun 20 '24 06:06 Arlodotexe

@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 https://github.com/CommunityToolkit/Windows/pull/446 for review, no AoT enabled on this branch.

Arlodotexe avatar Jul 02 '24 19:07 Arlodotexe

@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.

Sergio0694 avatar Jul 02 '24 20:07 Sergio0694

@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.

manodasanW avatar Jul 02 '24 20:07 manodasanW

@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 avatar Jul 02 '24 21:07 Arlodotexe

@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.

Arlodotexe avatar Jul 02 '24 21:07 Arlodotexe

Thanks @Arlodotexe All 3 errors look related to our KeyVauluePair bug (https://github.com/microsoft/CsWinRT/issues/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;

manodasanW avatar Jul 02 '24 21:07 manodasanW

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.

Arlodotexe avatar Jul 02 '24 23:07 Arlodotexe

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.

manodasanW avatar Jul 03 '24 01:07 manodasanW

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

Arlodotexe avatar Jul 04 '24 00:07 Arlodotexe

@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

manodasanW avatar Jul 25 '24 00:07 manodasanW

Kicking the failed job, probably https://github.com/CommunityToolkit/Windows/issues/347 again?

michael-hawker avatar Jul 31 '24 18:07 michael-hawker

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.

Arlodotexe avatar Jul 31 '24 21:07 Arlodotexe

@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.

manodasanW avatar Aug 14 '24 18:08 manodasanW

I've got successful local builds with the latest changes, but CI in both https://github.com/CommunityToolkit/Windows/pull/457 and https://github.com/CommunityToolkit/Labs-Windows/pull/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 avatar Aug 16 '24 18:08 Arlodotexe

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 :thinking:

Arlodotexe avatar Aug 16 '24 21:08 Arlodotexe

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

Arlodotexe avatar Aug 16 '24 22:08 Arlodotexe