Skip to content

Xaml Internal Error WMC9999 on when updating to v8.1-rc #185

Closed

Description

@morning4coffe-dev

Describe the bug

After updating the CommunityToolkit.WinUI packages to version 8.1.240328-rc in my Uno application, I encountered the following error on all platforms across multiple xaml pages:

Xaml Internal Error error WMC9999: Type universe cannot resolve assembly: Uno.UI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null.

Steps to reproduce

run https://github.com/morning4coffe-dev/uno-wtc-8-1

or

1. Create an Uno app
2. Reference some of the `CommunityToolkit.WinUI` package with the version 8.1.240328-rc
3. Try to run the app

Expected behavior

The project should launch without any needed workarounds.

Screenshots

No response

Code Platform

  • UWP
  • WinAppSDK / WinUI 3
  • Web Assembly (WASM)
  • Android
  • iOS
  • MacOS
  • Linux / GTK

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 10 21H2 (Build 19044)
  • Windows 10 22H2 (Build 19045)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Windows 10, version 2104 (Build 20348)
  • Windows 11, version 22H2 (Build 22000)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

2022

Visual Studio Build Number

No response

Device form factor

No response

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item.

Activity

  1. agneszitte commented on Apr 1, 2024

    @agneszitte

    @morning4coffe-dev I think it is related to the previous discussion I had with @michael-hawker, @Arlodotexe, and @jeromelaban the other day on the Uno Platform discord server: https://discord.com/channels/1182775715242967050/1193995186951426048/1221942998976303214

    Based on my previous test last week and another one today with latest rc:

    At the moment building a blank Uno project with the CommunityToolkit.WinUI.Behaviors package (version 8.1.240322-build.993 - nightly build or latest version 8.1.240328-rc) requires an update to net8.0-windows10.0.22621.
    It also necessitates updating the Microsoft.WindowsAppSDK to the latest version (1.5.240311000).
    With these updates, I successfully tested the WCT StackedNotificationsBehavior across multiple platforms, including Windows (Unpackaged/Packaged), Android, iOS, WASM, and Skia, and it worked well on all of them.
    (I have attached the sample app that I created, and tested with both versions and that uses the latest stable Uno.WinUI version 5.1.104 - UnoWCTStackedNotificationsBehavior.zip)

    I think @jeromelaban is supposed to sync with @michael-hawker and @Arlodotexe about some adjustments needed on the WCT side for the sdk version.

  2. morning4coffe-dev commented on Apr 1, 2024

    @morning4coffe-dev
    Author

    Thanks for the info @agneszitte. Adding @MartinZikmund to the conversation as well. Please let me know when the adjustments are done, so I can test it.

  3. agneszitte commented on Apr 1, 2024

    @agneszitte

    Thanks for the info @agneszitte. Adding @MartinZikmund to the conversation as well. Please let me know when the adjustments are done, so I can test it.

    @morning4coffe-dev
    As I only used StackedNotificationsBehavior (CommunityToolkit.WinUI.Behaviors) for my last tests, can you try to quickly update your current sample app that is using SettingsCard (CommunityToolkit.WinUI.Controls) with net8.0-windows10.0.22621 and updating the Microsoft.WindowsAppSDK to the latest version 1.5.240311000 just to make sure that it is working properly as well, please?

  4. jeromelaban commented on Apr 2, 2024

    @jeromelaban
    Contributor

    @Arlodotexe One of the possible changes to avoid error messages of this kind is to add lib/net7.0-windows10.0.18362 and lib/net8.0-windows10.0.18362 folder with a _._ file in most uno-referencing packages. This would prevent transitive dependencies to go to the wrong TargetFramework. It won't allow for the build to work, but it would not be that much misleading.

    In this particular case, the issue is coming from this path that is incorrectly selected by nuget:

    .nuget\packages\communitytoolkit.winui.controls.settingscontrols\8.1.240328-rc\lib\net7.0\CommunityToolkit.WinUI.Controls.SettingsControls.dll
    
  5. morning4coffe-dev commented on Apr 2, 2024

    @morning4coffe-dev
    Author

    @agneszitte I can confirm that after updating the versions, the workaround works for SettingsCard too.

  6. Arlodotexe commented on Apr 2, 2024

    @Arlodotexe
    Member

    @Arlodotexe One of the possible changes to avoid error messages of this kind is to add lib/net7.0-windows10.0.18362 and lib/net8.0-windows10.0.18362 folder with a _._ file in most uno-referencing packages. This would prevent transitive dependencies to go to the wrong TargetFramework. It won't allow for the build to work, but it would not be that much misleading.

    In this particular case, the issue is coming from this path that is incorrectly selected by nuget:

    .nuget\packages\communitytoolkit.winui.controls.settingscontrols\8.1.240328-rc\lib\net7.0\CommunityToolkit.WinUI.Controls.SettingsControls.dll
    

    Thanks @jeromelaban! I wasn't aware that you could do this, I'll give it a try and see if the next underlying error message is cleaner. Thanks @agneszitte for setting up a repro, should come in handy. 🙂

  7. Arlodotexe commented on Apr 8, 2024

    @Arlodotexe
    Member

    With the _._ workaround for TFM selection, here's the new error messages:

    Failing build using TFM net*-windows10.0.18362:

    1>------ Build started: Project: UnoWCTStackedNotificationsBehavior, Configuration: Debug Any CPU ------
    1>UnoWCTStackedNotificationsBehavior -> D:\UnoWCTStackedNotificationsBehavior\UnoWCTStackedNotificationsBehavior\bin\Debug\net8.0\UnoWCTStackedNotificationsBehavior.dll
    1>UnoWCTStackedNotificationsBehavior -> D:\UnoWCTStackedNotificationsBehavior\UnoWCTStackedNotificationsBehavior\bin\Debug\net8.0-ios\UnoWCTStackedNotificationsBehavior.dll
    1>UnoWCTStackedNotificationsBehavior -> D:\UnoWCTStackedNotificationsBehavior\UnoWCTStackedNotificationsBehavior\bin\Debug\net8.0-maccatalyst\UnoWCTStackedNotificationsBehavior.dll
    1>UnoWCTStackedNotificationsBehavior -> D:\UnoWCTStackedNotificationsBehavior\UnoWCTStackedNotificationsBehavior\bin\Debug\net8.0-android\UnoWCTStackedNotificationsBehavior.dll
    1>D:\UnoWCTStackedNotificationsBehavior\UnoWCTStackedNotificationsBehavior\MainPage.xaml.cs(1,24,1,29): error CS0234: The type or namespace name 'WinUI' does not exist in the namespace 'CommunityToolkit' (are you missing an assembly reference?)
    1>D:\UnoWCTStackedNotificationsBehavior\UnoWCTStackedNotificationsBehavior\obj\Debug\net8.0-windows10.0.18362\MainPage.g.i.cs(20,42,20,47): error CS0234: The type or namespace name 'WinUI' does not exist in the namespace 'CommunityToolkit' (are you missing an assembly reference?)
    1>Done building project "UnoWCTStackedNotificationsBehavior.csproj" -- FAILED.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    ========== Build completed at 11:12 AM and took 05.869 seconds ==========
    

    This doesn't explain what to do to consumers, but it's a bit less vague than before. We'll be sure to call out the update requirement in the blog post and release notes.

    The build error is still resolved by updating the project referencing the toolkit to net*-windows10.0.22621.

  8. moved this from 🏗 In progress to 👀 In review in Toolkit 8.xon Apr 11, 2024
  9. moved this from 👀 In review to ✅ Done in Toolkit 8.xon Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions