Comments (4)
Here is my attempt to create AOT friendly json serializer https://github.com/wieslawsoltes/Dock/tree/master/src/Dock.Model.Avalonia/Json
from dock.
The Avalonia portions (controls) should be already AOT friendly (did not test recently). The models need to support Json AOT serializer. The MVVM https://github.com/wieslawsoltes/Dock/tree/master/src/Dock.Model.Mvvm should be easy to add support, much harder is Avalonia Model https://github.com/wieslawsoltes/Dock/tree/master/src/Dock.Model.Avalonia
from dock.
Interesting, when I try to do aot compilation on any app that includes this control (including the sample notepad app), I end up with compilation errors. I guess initially I thought it might be related to the lack of compiled bindings, but going through the error again, it looks like this might actually be a compiler error (!?). Have you seen this before?
There still are trim warnings though, which are essentially the following (lots more than just these):
C:\Code\Dock\src\Dock.Avalonia\Controls/DocumentContentControl.axaml(12): Trim analysis warning IL2026: CompiledAvaloniaXaml.!AvaloniaResources.XamlClosure_17.XamlClosure_18.Build(IServiceProvider): Using member 'Avalonia.Markup.Xaml.MarkupExtensions.ReflectionBindingExtension.ReflectionBindingExtension()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. BindingExpression and ReflectionBinding heavily use reflection. Consider using CompiledBindings instead. [C:\Code\Dock\samples\Notepad\Notepad.csproj]
C:\Code\Dock\src\Dock.Avalonia\Controls/DocumentContentControl.axaml(13): Trim analysis warning IL2026: CompiledAvaloniaXaml.!AvaloniaResources.XamlClosure_17.XamlClosure_18.Build(IServiceProvider): Using member 'Avalonia.Markup.Xaml.MarkupExtensions.ReflectionBindingExtension.ReflectionBindingExtension()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. BindingExpression and ReflectionBinding heavily use reflection. Consider using CompiledBindings instead. [C:\Code\Dock\samples\Notepad\Notepad.csproj]
C:\Code\Dock\src\Dock.Avalonia\Controls/DockDockControl.axaml(18): Trim analysis warning IL2026: CompiledAvaloniaXaml.!AvaloniaResources.XamlClosure_12.XamlClosure_13.Build(IServiceProvider): Using member 'Avalonia.Markup.Xaml.MarkupExtensions.ReflectionBindingExtension.ReflectionBindingExtension(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. BindingExpression and ReflectionBinding heavily use reflection. Consider using CompiledBindings instead. [C:\Code\Dock\samples\Notepad\Notepad.csproj]
C:\Code\Dock\src\Dock.Avalonia\Controls/DockDockControl.axaml(22): Trim analysis warning IL2026: CompiledAvaloniaXaml.!AvaloniaResources.XamlClosure_12.XamlClosure_13.Build(IServiceProvider): Using member 'Avalonia.Markup.Xaml.MarkupExtensions.ReflectionBindingExtension.ReflectionBindingExtension(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. BindingExpression and ReflectionBinding heavily use reflection. Consider using CompiledBindings instead. [C:\Code\Dock\samples\Notepad\Notepad.csproj]
The potential compiler error:
<unknown>:0: error: assembler label '' can not be undefined
<unknown>:0: error: assembler label '' can not be undefined
<unknown>:0: error: assembler label '' can not be undefined
<unknown>:0: error: assembler label '' can not be undefined
<unknown>:0: error: assembler label '' can not be undefined
<unknown>:0: error: assembler label '' can not be undefined
<unknown>:0: error: assembler label '' can not be undefined
<unknown>:0: error: assembler label '' can not be undefined
<unknown>:0: error: assembler label '' can not be undefined
<unknown>:0: error: assembler label '' can not be undefined
<unknown>:0: error: assembler label '' can not be undefined
<unknown>:0: error: assembler label '' can not be undefined
<unknown>:0: error: assembler label '' can not be undefined
<unknown>:0: error: assembler label '' can not be undefined
EXEC : error : Arithmetic operation resulted in an overflow. [C:\Code\Dock\samples\Notepad\Notepad.csproj]
System.OverflowException: Arithmetic operation resulted in an overflow.
at Internal.Runtime.CompilerHelpers.ThrowHelpers.ThrowOverflowException() + 0x24
at ILCompiler.DependencyAnalysis.InterfaceDispatchMapNode.EmitDispatchMap(ObjectDataBuilder&, NodeFactory) + 0x2a2e
at ILCompiler.DependencyAnalysis.InterfaceDispatchMapNode.GetData(NodeFactory, Boolean) + 0x111
at ILCompiler.DependencyAnalysis.ObjectWriter.EmitObject(String, IReadOnlyCollection`1, NodeFactory, ObjectWritingOptions, IObjectDumper, Logger) + 0x50f
at ILCompiler.RyuJitCompilation.CompileInternal(String, ObjectDumper) + 0xad
at ILCompiler.Compilation.ILCompiler.ICompilation.Compile(String, ObjectDumper) + 0x2d
at ILCompiler.Program.Run() + 0x2778
at ILCompiler.ILCompilerRootCommand.<>c__DisplayClass221_0.<.ctor>b__0(ParseResult result) + 0x315
This happens when attempting to publish with PublishAot
set to true
in the project, not during a regular compile.
from dock.
Its runtime bug not Dock issue
from dock.
Related Issues (20)
- Dock marks don't show up. HOT 1
- UserControls inside Tool (and probably in every dockable) always null in code
- . HOT 1
- After close all documents when is created a new one it not update/show automatically HOT 1
- Restoring a layout which re-docks floating documents causes exceptions HOT 4
- HostWindowTitleBar has a Foreground Brush not appropriate for Simple (Dark) theme. HOT 1
- [BUG] Binding does not work on Tool
- ProportionalDock is covering up the DocumentDock HOT 1
- Document.OnClose() should return Task<bool>
- Dock.Avalonia 11.0.0.5 NuGet on net8 gives error The type or namespace name 'Factory' could not be found
- Docking tracking disabling when tool window is outside screen HOT 2
- Community Support Schedule and Approach HOT 3
- Fonts change when floating a window HOT 1
- Dock floated tool window cant be docked HOT 8
- Where did the wiki go? HOT 1
- After closing all documents, new document won't open HOT 6
- Nested Docks HOT 1
- How to globally disable undocking? HOT 2
- After Restore layout in DockXamlSample, the methods InsertDockable and RemoveDockable not work. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dock.