-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Warnings and errors when publishing a .NET 8 app as NativeAOT #367
Comments
Ok, will give it another go with that change later. On a related note, the use of Linq.Expression at https://github.com/fsprojects/Avalonia.FuncUI/blob/b0aa279c9760a2be2417230aad267a499bec2d47/src/Avalonia.FuncUI/DataTemplateView.fs#L16C1-L16C1 seems to cause problems for the trimmer too (like, it can't see what the delegate given to DataTemplateView is doing and can trim out things that are used by it). |
Actually, only just noticed, but the error in the callstack is
but it appears that in fact, Component doesn't have a parameterless constructor anyway? |
Yup, Component constructor needs a render function. |
But that makes it sound like something has gone awry and is trying to call the wrong constructor :-( |
Yeah.. that should never happen. If you can reproduce it let me know and I'll take a look |
Something else must be getting removed when it shouldn't be I suppose. fwiw, the two warnings about type ViewDelta =
{ [<DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)>] ViewType: Type
Attrs: AttrDelta list
ConstructorArgs: obj array
KeyDidChange: bool
Outlet: (AvaloniaObject -> unit) voption } but you then get
from |
I get a similar error with the
and it crashes when run. |
The change in #399 appears to fix the crash I was seeing before in a NativeAOT build on my app, and also gets the ContactBook example further (it then falls over inside Bogus, but that's a different situation) |
With the changes in #423 I have the control catalog running in NativeAOT in .NET 8.0 :-) It does look like the drag and drop demo doesn't actually drag (on Windows at least), but that might be an issue with COM interop in Avalonia - needs an extra testing. |
This is a sort of followup to #281, but with a few FuncUI specific warnings in the build that might have local solutions, so -
I tried updating a FuncUI app to .NET 8 and publishing as NativeAOT with the RC2 SDK.
There are alas loads of warnings from FSharp.Core that are outside our control, but also these ones from FuncUI:
and then this happens at runtime:
Which suggests that the existing
DynamicallyAccessedMembers
attributes aren't covering all required cases.Also, some of this might be hitting the existing TODO here about not using reflection:
Avalonia.FuncUI/src/Avalonia.FuncUI/VirtualDom/VirtualDom.Patcher.fs
Line 75 in a3b4b41
The text was updated successfully, but these errors were encountered: