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

[Bug] Can't reload ( Static resource not found) #9

Open
MakesYT opened this issue May 26, 2024 · 2 comments
Open

[Bug] Can't reload ( Static resource not found) #9

MakesYT opened this issue May 26, 2024 · 2 comments

Comments

@MakesYT
Copy link

MakesYT commented May 26, 2024

Not sure why I encountered an overloading error, but I couldn't create a minimal example of the problem because I couldn't reproduce the bug
Src code: https://github.com/MakesYT/Kitopia/blob/886a4785a087b41381fe005f655d974c388889b3/KitopiaAvalonia/Windows/SearchWindow.axaml

 <Button ToolTip.Tip="{Binding Path=. ,Converter={StaticResource SearchItemToInfo}}"
[2024-05-26 21:18:49,452-ERROR][2][Program] System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Static resource 'SearchItemToInfo' not found.)
 ---> System.Collections.Generic.KeyNotFoundException: Static resource 'SearchItemToInfo' not found.
   at Avalonia.Markup.Xaml.MarkupExtensions.StaticResourceExtension.ProvideValue(IServiceProvider serviceProvider)
   at KitopiaAvalonia.Windows.SearchWindow.XamlClosure_21.Build_12(IServiceProvider) in D:\WPF.net\Kitopia\KitopiaAvalonia\Windows/SearchWindow.axaml:line 83
   at Avalonia.Markup.Xaml.XamlIl.Runtime.XamlIlRuntimeHelpers.PointerDeferredContent`1.InvokeBuilder(IServiceProvider serviceProvider)
   at Avalonia.Markup.Xaml.XamlIl.Runtime.XamlIlRuntimeHelpers.DeferredContent`1.Build(IServiceProvider serviceProvider)
   at Avalonia.Markup.Xaml.Templates.TemplateContent.Load[T](Object templateContent)
   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.Controls.VirtualizingStackPanel.RealizeElements(IReadOnlyList`1 items, Size availableSize, MeasureViewport& viewport)
   at Avalonia.Controls.VirtualizingStackPanel.MeasureOverride(Size availableSize)
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize)
   at Avalonia.Layout.Layoutable.Measure(Size availableSize)
   at Avalonia.Layout.LayoutManager.Measure(Layoutable control)
   at Avalonia.Layout.LayoutManager.ExecuteMeasurePass()
   at Avalonia.Layout.LayoutManager.InnerLayoutPass()
   at Avalonia.Layout.LayoutManager.ExecuteLayoutPass()
   at Avalonia.Layout.LayoutManager.ExecuteQueuedLayoutPass()
   at Avalonia.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at Avalonia.Media.MediaContext.RenderCore()
   at Avalonia.Media.MediaContext.Render()
   at Avalonia.Threading.DispatcherOperation.InvokeCore()
   --- End of inner exception stack trace ---
[2024-05-26 21:18:49,454-ERROR][2][Program] System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Can only add items to the beginning or end of realized elements.)
 ---> System.NotSupportedException: Can only add items to the beginning or end of realized elements.
   at Avalonia.Controls.Utils.RealizedStackElements.Add(Int32 index, Control element, Double u, Double sizeU)
   at Avalonia.Controls.VirtualizingStackPanel.RealizeElements(IReadOnlyList`1 items, Size availableSize, MeasureViewport& viewport)
   at Avalonia.Controls.VirtualizingStackPanel.MeasureOverride(Size availableSize)
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize)
   at Avalonia.Layout.Layoutable.Measure(Size availableSize)
   at Avalonia.Layout.LayoutManager.Measure(Layoutable control)
   at Avalonia.Layout.LayoutManager.ExecuteMeasurePass()
   at Avalonia.Layout.LayoutManager.InnerLayoutPass()
   at Avalonia.Layout.LayoutManager.ExecuteLayoutPass()
   at Avalonia.Layout.LayoutManager.ExecuteQueuedLayoutPass()
   at Avalonia.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at Avalonia.Media.MediaContext.RenderCore()
   at Avalonia.Media.MediaContext.Render()
   at Avalonia.Threading.DispatcherOperation.InvokeCore()
   --- End of inner exception stack trace ---

@Kir-Antipov
Copy link
Owner

Sadly, there's not much I can do here: you couldn't build an MRE, and I cannot build your project to investigate what's going on because the KitopiaWeb submodule doesn't seem to be public. Your prebuilt binaries are merged into a single file in an unholy union, so I cannot easily investigate those via ILSpy. And I certainly do not have the Avalonia XAML compiler built directly into my brain (for better or for worse :D), so SearchWindow.axaml is not particularly useful for me as there are no obvious issues with it.

Without at least one of these approaches being accessible to investigate the issue, your guess as to what's gone wrong is as good as mine.

I would greatly appreciate if you could run a CI to build your project without merging it into a single file, so I can grab it from GitHub and inspect the code generated by Avalonia.

@MakesYT
Copy link
Author

MakesYT commented May 28, 2024

Sadly, there's not much I can do here: you couldn't build an MRE, and I cannot build your project to investigate what's going on because the KitopiaWeb submodule doesn't seem to be public. Your prebuilt binaries are merged into a single file in an unholy union, so I cannot easily investigate those via ILSpy. And I certainly do not have the Avalonia XAML compiler built directly into my brain (for better or for worse :D), so SearchWindow.axaml is not particularly useful for me as there are no obvious issues with it.

Without at least one of these approaches being accessible to investigate the issue, your guess as to what's gone wrong is as good as mine.

I would greatly appreciate if you could run a CI to build your project without merging it into a single file, so I can grab it from GitHub and inspect the code generated by Avalonia.

KitopiaWeb has no impact on the build project. It is a relatively independent project.
There are non-single file builds here
https://github.com/MakesYT/Kitopia/releases/tag/0.0.2.049

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

No branches or pull requests

2 participants