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

CommunityToolkit.WinUI.xxx 8.1.240916 issue #543

Open
2 of 14 tasks
JLBLU opened this issue Sep 17, 2024 · 8 comments
Open
2 of 14 tasks

CommunityToolkit.WinUI.xxx 8.1.240916 issue #543

JLBLU opened this issue Sep 17, 2024 · 8 comments
Assignees

Comments

@JLBLU
Copy link

JLBLU commented Sep 17, 2024

Describe the bug

Hi,

After installation of CommunityToolkit.WinUI.xxx (*) new versions (from 8.1.240821 to 8.1.240916), following issue occurs during execution :

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

Failed to assign to property 'Microsoft.UI.Xaml.Controls.ItemsControl.ItemsSource'. [Line: 968 Position: 37]'

    //

    public DkItemLinksPage()
    {
        **this.InitializeComponent();**

...
///


/// InitializeComponent()
///

[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.UI.Xaml.Markup.Compiler"," 3.0.0.2408")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void InitializeComponent()
{
if (_contentLoaded)
return;

        _contentLoaded = true;

        global::System.Uri resourceLocator = new global::System.Uri("ms-appx:///Views/DkItemLinksPage.xaml");
        **global::Microsoft.UI.Xaml.Application.LoadComponent(this, resourceLocator, global::Microsoft.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);**
    }

(*) CommunityToolkit.WinUI.Extensions + .Helpers + .Controls.TabbedCommandBar + .Controls.Sizers + .Controls.RadialGauge + .Controls.Primitives + + .Controls.layoutTransformControl + .Controls.Sizers + .Controls.Behaviors

//
Also warning :

DEP0840: Project 'XXXXX' `requires packages 'MicrosoftCorporationII.WinAppRuntime.Main.1.6_8wekyb3d8bbwe' and 'MicrosoftCorporationII.WinAppRuntime.Singleton_8wekyb3d8bbwe' with version version >= « 6000.242.101.0 ».. These packages should be installed on first run, if not please visit http://go.microsoft.com/fwlink/?linkid=2222757 for installation instructions.
(despite several clean+rebuild)

//

WinExe net8.0-windows10.0.26100.0 10.0.17763.0 10.0.22621.38 app.manifest x64 win-x64 win-$(Platform).pubxml true

best regards,
Jean-Luc

Regression

CommunityToolkit.WinUI.xxx 8.1.240821

Reproducible in sample app?

  • This bug can be reproduced in the sample app.

Steps to reproduce

Navigate to page
                case "DkItemLink":
                    DkItemLinksPage.SetParentInfos(item, arrayTabLinksLib);
                    DkItemFrame.Navigate(typeof(DkItemLinksPage), this, navOptions.TransitionInfoOverride);
                    ToolTipService.SetToolTip(btnRemove, "Suppression" + Environment.NewLine + "   ligne");
                    ToolTipService.SetPlacement(btnRemove, PlacementMode.Bottom);
                    break;

/
Page contains controls :    
Grid,  DockPanel, AppBarButton, TextBlock, StackPanel, PasswordBox, TextBox, ComboBox, ScrollViewer, 
GridSplitter, DataGrid, DataGridTemplateColumn

Expected behavior

Cannot load screen.
Contains controls :
Grid, DockPanel, AppBarButton, TextBlock, StackPanel, PasswordBox, TextBox, ComboBox, ScrollViewer,
GridSplitter, DataGrid, DataGridTemplateColumn

Screenshots

image

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 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

Windows 11 23H2 Build 22631.4169

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)
  • Other (specify)

Other SDK version

target SDK version 10.0.621.0

Visual Studio Version

No response

Visual Studio Build Number

Microsoft Visual Studio Community 2022 (64 bits) - Current Version 17.11.3

Device form factor

Desktop

Nuget packages

CommunityToolkit.WinUI.xxx () new versions 8.1.240916
(
) CommunityToolkit.WinUI.Extensions + .Helpers + .Controls.TabbedCommandBar + .Controls.Sizers + .Controls.RadialGauge + .Controls.Primitives + + .Controls.layoutTransformControl + .Controls.Sizers + .Controls.Behaviors
+
CommunityToolkit.Mvvm 8.3.1
+
Microsoft.WindowsAppSDK 1.6.240829007

Additional context

No response

Help us help you

No.

@DominikErnst
Copy link

DominikErnst commented Sep 19, 2024

Same here ...

Warning DEP0840: Project 'CTI2' requires packages 'MicrosoftCorporationII.WinAppRuntime.Main.1.6_8wekyb3d8bbwe' and 'MicrosoftCorporationII.WinAppRuntime.Singleton_8wekyb3d8bbwe' with version >= '6000.242.101.0'. These packages should be installed on first run, if not please visit http://go.microsoft.com/fwlink/?linkid=2222757 for installation instructions. CTI2

<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework> <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion> <RootNamespace>CTI2</RootNamespace> <ApplicationIcon>Assets/WindowIcon.ico</ApplicationIcon> <ApplicationManifest>app.manifest</ApplicationManifest> <Platforms>AnyCPU;x64;x86</Platforms> <RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &gt;= 8">win-x86;win-x64;win-arm64</RuntimeIdentifiers> <RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) &lt; 8">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers> <PublishProfile>Properties\PublishProfiles\win10-$(Platform).pubxml</PublishProfile> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <WindowsSdkPackageVersion>10.0.19041.38</WindowsSdkPackageVersion> <UseWinUI>true</UseWinUI> <EnableMsixTooling>true</EnableMsixTooling> <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> </PropertyGroup> <ItemGroup> <None Remove="Views\CallerHistoryPage.xaml" /> <None Remove="Views\CallPage.xaml" /> <None Remove="Views\MainPage.xaml" /> <None Remove="Views\OrdersPage.xaml" /> </ItemGroup> <ItemGroup> <Manifest Include="$(ApplicationManifest)" /> </ItemGroup> <ItemGroup> <PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" /> <PackageReference Include="CommunityToolkit.WinUI.Animations" Version="8.1.240916" /> <PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.1.240916" /> <PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.1.240916" /> <PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.1.240916" /> <PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.1.240916" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" /> <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240829007" /> <PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" /> <PackageReference Include="Swyx.Client.ClmgrAPI" Version="14.1.0" /> <PackageReference Include="System.Text.Json" Version="8.0.4" /> <PackageReference Include="WinUIEx" Version="2.4.0" /> </ItemGroup> <PropertyGroup> <WindowsSdkPackageVersion>10.0.19041.38</WindowsSdkPackageVersion> <PackageCertificateThumbprint>538396775AC04C2F949B13EC21563E4CC9F39D2D</PackageCertificateThumbprint> <AppxPackageSigningEnabled>True</AppxPackageSigningEnabled> <SupportedOSPlatformVersion>10.0.18362.0</SupportedOSPlatformVersion> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\CTI2.Core\CTI2.Core.csproj" /> </ItemGroup> <ItemGroup> <None Update="appsettings.json"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> <Page Update="Views\OrdersPage.xaml"> <Generator>MSBuild:Compile</Generator> </Page> <Page Update="Views\CallPage.xaml"> <Generator>MSBuild:Compile</Generator> </Page> <Page Update="Views\MainPage.xaml"> <Generator>MSBuild:Compile</Generator> </Page> <Page Update="Views\CallerHistoryPage.xaml"> <Generator>MSBuild:Compile</Generator> </Page> </ItemGroup> <ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'"> <ProjectCapability Include="Msix" /> </ItemGroup> <PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'"> <HasPackageAndPublishMenu>true</HasPackageAndPublishMenu> </PropertyGroup> </Project>

When I compile the app, the warning is gone, only when I start the app does the warning reappear.

@Arlodotexe Arlodotexe transferred this issue from CommunityToolkit/WindowsCommunityToolkit Oct 31, 2024
@tiara-kastner-fhooe
Copy link

Hello there,

I am using Windows 10 22H2 with VisualStudio 2022 17.11.5 x64 and dotnet 8.0.10 and windows app sdk 1.6.1.

I had the same issue with WinUI3 in general. I had my VisualStudio 2022 running in admin mode which was the culprit for me. Once i launched everything in a normal user context without elevated permissions, it started working again.

Maybe that will do as a workaround for you.

@Arlodotexe
Copy link
Member

This seems like the error we encountered in #516, which ended up being a platform issue.

@JLBLU Could you please try updating to the latest Preview Packages on the MainLatest feed and see if that resolves your issue?

@Arlodotexe Arlodotexe moved this to 🔖 Ready in Toolkit 8.x Nov 13, 2024
@Arlodotexe Arlodotexe self-assigned this Nov 13, 2024
@JLBLU
Copy link
Author

JLBLU commented Nov 20, 2024

Hi @Arlodotexe

For example, I have no issue with CommunityToolkit.Mvvm 8.2.1 and issue occurs with 8.2.2, even with last version 8.4.0 preview 2

@michael-hawker
Copy link
Member

@JLBLU you started with the Windows Community Toolkit WinUI.* packages, we're still talking about those. If you're also having issues with the MVVM packages, you should file a separate issue about those at https://github.com/CommunityToolkit/dotnet.

For your original issue here, do you see any change with the latest 8.2.241112-preview1 packages makes a difference?

@JLBLU
Copy link
Author

JLBLU commented Nov 28, 2024

Hi,

For this issue :
Microsoft.UI.Xaml.Markup.XamlParseException : 'The text associated with this error code could not be found.'
Failed to assign to property 'Microsoft.UI.Xaml.Controls.ItemsControl.ItemsSource'. [Line: 968 Position: 37]'

I've found that issue comes from the fact that I had a control ComboBox with an ComboBox.ItemTemplate :

                    <ComboBox   Name="cmbTextColorRight" 
                                Grid.Row="11" Grid.Column="0" 
                                MinWidth="150"
                                Margin="5,15,5,0"
                                VerticalAlignment="Center"
                                Tag="TextColor"
                                ItemsSource="{Binding Source={StaticResource textColorsSource}, Path=TextColors}"
                                SelectedValuePath="Key"
                                SelectedValue="{Binding SelectedLinkItem.LnkColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
                        <ComboBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock VerticalAlignment="Center" Text="{Binding Path=Value}"
                                               Foreground="{Binding Path=Key}"/>
                                </StackPanel>
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>

The aim was to display a list of items with colored text.
This worked for years... but no longer seems compatible with the latest version of... what?

@JLBLU
Copy link
Author

JLBLU commented Dec 9, 2024

Works this way : (modify ItemSource (array class instead static dictionary) and add a Converter to display ColorName

                    <ComboBox   Name="cmbTextColorRight" 
                                Grid.Row="11" Grid.Column="0" 
                                MinWidth="150"
                                Margin="5,15,5,0"
                                VerticalAlignment="Center"
                                Tag="TextColor"
                                ItemsSource="{x:Bind m:DkTextColor.GetClassArrayTextColor()}"
                                SelectedValuePath="ColorKey"
                                SelectedValue="{Binding SelectedLinkItem.LnkColor, 
                                                        Mode=TwoWay, 
                                                        UpdateSourceTrigger=PropertyChanged}">
                        <ComboBox.ItemTemplate>
                            <DataTemplate x:DataType="m:DkTextColor">
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock VerticalAlignment="Center" 
                                               Text="{Binding Path=ColorKey, 
                                                              Converter={StaticResource textColorsConverter}}"
                                               Foreground="{Binding Path=ColorKey}"/>
                                </StackPanel>
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>

@michael-hawker
Copy link
Member

@JLBLU the code/issue you're now describing seems to not involve any Windows Community Toolkit code now?

If so, then you'd probably want to follow-up and search/file a new issue with that minimal reproduction in the WinUI repo: https://github.com/microsoft/microsoft-ui-xaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔖 Ready
Development

No branches or pull requests

5 participants