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

[11.0.0.7] System.Collections.Generic.KeyNotFoundException: Static resource 'Avalonia.Controls.Button' not found #336

Closed
Sputnik24 opened this issue Apr 18, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Sputnik24
Copy link

Sputnik24 commented Apr 18, 2024

I upgraded my solution from 11.0.0.6 to 11.0.0.7 (Avalonia is on 11.0.10) which gives the following exception on BuildAvaloniaApp() in Program.cs:

System.Collections.Generic.KeyNotFoundException: Static resource 'Avalonia.Controls.Button' not found. at Avalonia.Markup.Xaml.MarkupExtensions.StaticResourceExtension.ProvideValue(IServiceProvider serviceProvider) at CompiledAvaloniaXaml.!AvaloniaResources.XamlClosure_75.Build(IServiceProvider) in D:\a\1\s\src\Dock.Avalonia\Controls/ToolChromeControl.axaml:line 37 at Avalonia.Markup.Xaml.XamlIl.Runtime.XamlIlRuntimeHelpers.<>c__DisplayClass1_01.b__0(IServiceProvider sp)
at Avalonia.Controls.ResourceDictionary.TryGetValue(Object key, Object& value)
at Avalonia.Controls.ResourceDictionary.TryGetResource(Object key, ThemeVariant theme, Object& value)
at Avalonia.Markup.Xaml.MarkupExtensions.StaticResourceExtension.ProvideValue(IServiceProvider serviceProvider)
at CompiledAvaloniaXaml.!AvaloniaResources.XamlClosure_76.XamlClosure_77.Build(IServiceProvider) in D:\a\1\s\src\Dock.Avalonia\Controls/ToolChromeControl.axaml:line 78
at Avalonia.Markup.Xaml.XamlIl.Runtime.XamlIlRuntimeHelpers.<>c__DisplayClass1_01.<DeferredTransformationFactoryV2>b__0(IServiceProvider sp) at Avalonia.Markup.Xaml.Templates.TemplateContent.Load(Object templateContent) at Avalonia.Markup.Xaml.Templates.ControlTemplate.Build(TemplatedControl control) at Avalonia.Controls.Primitives.TemplatedControl.ApplyTemplate() at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Dock.Avalonia.Controls.ProportionalStackPanel.MeasureOverride(Size constraint) in /_/src/Dock.Avalonia/Controls/ProportionalStackPanel.cs:line 267 at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) at Avalonia.Controls.Border.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Controls.DockPanel.MeasureOverride(Size constraint) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Controls.DockPanel.MeasureOverride(Size constraint) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Controls.DockPanel.MeasureOverride(Size constraint) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding) at Avalonia.Controls.Decorator.MeasureOverride(Size availableSize) at Avalonia.Controls.Primitives.VisualLayerManager.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) at Avalonia.Controls.Window.MeasureOverride(Size availableSize) at Avalonia.Controls.WindowBase.MeasureCore(Size availableSize) at Avalonia.Layout.Layoutable.Measure(Size availableSize) at Avalonia.Layout.LayoutManager.Measure(Layoutable control) at Avalonia.Layout.LayoutManager.ExecuteInitialLayoutPass() at Avalonia.Controls.Window.ShowCore(Window owner) at Avalonia.Controls.Window.Show() at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.ShowMainWindow() at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action1 lifetimeBuilder)
at Program.Main(String[] args) in .\Program.cs:line 15`

@Sputnik24 Sputnik24 changed the title [11.0.7] System.Collections.Generic.KeyNotFoundException: Static resource 'Avalonia.Controls.Button' not found [11.0.0.7] System.Collections.Generic.KeyNotFoundException: Static resource 'Avalonia.Controls.Button' not found Apr 18, 2024
@wieslawsoltes
Copy link
Owner

Interesting seems like some sort of backward abi compatibility issue in Avalonia, don't think can do anything here beside updating Dock to use 11.0.10

@wieslawsoltes wieslawsoltes added the bug Something isn't working label Jun 1, 2024
@wieslawsoltes
Copy link
Owner

Fixed in 11.0.10

@Sputnik24
Copy link
Author

Fix is not working, same error still occurs.

@wieslawsoltes
Copy link
Owner

Fix is not working, same error still occurs.

Please provide sample code to reproduce issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants