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

Microsoft.UI.Xaml.Markup.XamlParseException: 'The text associated with this error code could not be found. #9823

Closed
hippieZhou opened this issue Jul 16, 2024 · 6 comments
Labels
area-External Not owned by the WinUI team, not actionable in this repository. bug Something isn't working team-Markup Issue for the Markup team

Comments

@hippieZhou
Copy link

hippieZhou commented Jul 16, 2024

Describe the bug

I met this error when I upgraded Microsoft.WindowsAppSDK to '1.6.240701003-experimental2'.

Steps to reproduce the bug

  1. set TargetType for controls:SwitchPresenter control
  2. upgrade Microsoft.WindowsAppSDK to '1.6.240701003-experimental2'.

Expected behavior

No Exception

Screenshots

image

NuGet package version

Windows App SDK 1.6 Experimental 2: 1.6.240701003-experimental2

Packaging type

Packaged (MSIX), Unpackaged

Windows version

No response

IDE

Visual Studio 2022

Additional context

No response

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jul 16, 2024
@codendone codendone transferred this issue from microsoft/WindowsAppSDK Jul 16, 2024
@codendone codendone added bug Something isn't working area-ProjectSystem team-Markup Issue for the Markup team and removed needs-triage Issue needs to be triaged by the area owners labels Jul 16, 2024
@evelynwu-msft
Copy link
Contributor

evelynwu-msft commented Jul 19, 2024

@hippieZhou Could you provide a repro project? I'm not familiar with this control and the snippet in the screenshot isn't enough for me to be confident that I've recreated your scenario faithfully. Additionally, what version of Windows App SDK were you originally using before upgrading?

@evelynwu-msft
Copy link
Contributor

@manodasanW Did something change recently in how C#/WinRT projects Windows.UI.Xaml.Interop.TypeName to System.Type? In the repro project the WinUI framework is passing an object of type Windows.UI.Xaml.Interop.TypeName to the managed generated IXMP. If the project (targeting WinAppSDK 1.5.5) specifies <WindowsSdkPackageVersion>10.0.19041.35-preview</WindowsSdkPackageVersion> then an InvalidCastException is raised because the object is projected to type WinRT.IInspectable. If the aforementioned WindowsSdkPackageVersion override is commented out, then the object has the projected type System.Type as expected.

@manodasanW
Copy link
Member

Was able to repro it and can confirm this is fixed in the upcoming CsWinRT preview.

Fixed by microsoft/CsWinRT#1646

@evelynwu-msft
Copy link
Contributor

Was able to repro it and can confirm this is fixed in the upcoming CsWinRT preview.

Fixed by microsoft/CsWinRT#1646

Awesome, thanks!

@evelynwu-msft evelynwu-msft added area-External Not owned by the WinUI team, not actionable in this repository. and removed area-ProjectSystem labels Jul 20, 2024
@hippieZhou
Copy link
Author

hippieZhou commented Jul 21, 2024

@manodasanW if so, how can I resolve this issue in my project currently?

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jul 21, 2024
@JesseCol
Copy link

Hi, the latest update of C#/WinRT should have the fix. Thanks!

@JesseCol JesseCol removed the needs-triage Issue needs to be triaged by the area owners label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-External Not owned by the WinUI team, not actionable in this repository. bug Something isn't working team-Markup Issue for the Markup team
Projects
None yet
Development

No branches or pull requests

5 participants