You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In WinApp SDK 1.6 Experimental with AoT turned ON, build fails when using a property or method that returns a Dictionary with a strong type.
C:\repo\MyApp\MyApp\obj\x64\Release\net8.0-windows10.0.22621.0\win-x64\intermediatexaml\WinRT.SourceGenerator\Generator.WinRTAotSourceGenerator\WinRTGenericInstantiation.g.cs(1455,33,1455,53): error CS0234: The type or namespace name 'MyApp' does not exist in the namespace 'ABI' (are you missing an assembly reference?)
Steps to reproduce the bug
Project file:
<ProjectSdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>WinRTGenericMissing</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<WindowsSdkPackageVersion>10.0.22621.35-preview</WindowsSdkPackageVersion>
<PublishAot>true</PublishAot>
</PropertyGroup>
<ItemGroup>
<ContentInclude="Assets\SplashScreen.scale-200.png" />
<ContentInclude="Assets\LockScreenLogo.scale-200.png" />
<ContentInclude="Assets\Square150x150Logo.scale-200.png" />
<ContentInclude="Assets\Square44x44Logo.scale-200.png" />
<ContentInclude="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<ContentInclude="Assets\StoreLogo.png" />
<ContentInclude="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<PackageReferenceInclude="Microsoft.Windows.CsWinRT"Version="2.1.0-prerelease.240602.1" />
<PackageReferenceInclude="Microsoft.Windows.SDK.BuildTools"Version="10.0.26100.1" />
<PackageReferenceInclude="Microsoft.WindowsAppSDK"Version="1.6.240531000-experimental1" />
<ManifestInclude="$(ApplicationManifest)" />
</ItemGroup>
<!-- Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging Tools extension to be activated for this project even if the Windows App SDK Nuget package has not yet been restored.-->
<ItemGroupCondition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<ProjectCapabilityInclude="Msix" />
</ItemGroup>
<!-- Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution Explorer "Package and Publish" context menu entry to be enabled for this project even if the Windows App SDK Nuget package has not yet been restored.-->
<PropertyGroupCondition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
</PropertyGroup>
</Project>
And a C# file:
publicclassLearningData{}publicsealedpartialclassMainWindow:Window{// This does not build.privateasyncTask<Dictionary<string,LearningData>>DoesNotBuild(){}// This does build however. privateasyncTask<Dictionary<string,int>>DoesNotBuild(){}}
Expected behavior
Get it to build.
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6 Experimental 1: 1.6.240531000-experimental1
Windows version
Windows 11 (22H2): Build 22621
Additional context
The issue seems to reproduce with Dictionary<T, U> along with IReadOnlyDictionary<T, U>, and probably many others. It's interesting that using a value type on U makes it work.
The text was updated successfully, but these errors were encountered:
Describe the bug
In WinApp SDK 1.6 Experimental with AoT turned ON, build fails when using a property or method that returns a Dictionary with a strong type.
Steps to reproduce the bug
Project file:
And a C# file:
Expected behavior
Get it to build.
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6 Experimental 1: 1.6.240531000-experimental1
Windows version
Windows 11 (22H2): Build 22621
Additional context
The issue seems to reproduce with
Dictionary<T, U>
along withIReadOnlyDictionary<T, U>
, and probably many others. It's interesting that using a value type onU
makes it work.The text was updated successfully, but these errors were encountered: