-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
(Native AOT) No parameterless constructor defined for type #1146
Comments
@PaddiM8 did you figure out a work around for this? |
Unfortunately not. |
I am going to be looking into Microsoft.Data.Sqlite as an alternative, maybe it can work for your situation: https://learn.microsoft.com/en-us/windows/apps/develop/data-access/sqlite-data-access They've added AOT support: |
Ohh finally. That's what I've been using with Ready-to-Run. Thanks! |
This looks related to NativeAOT specifically with COM. I think there's part been work here for .NET 8 but I'm not sure if that will automatically solve this? Otherwise, maybe a developer might take a look at this: https://stackoverflow.com/questions/76507803/c-sharp-net-core-native-aot-with-reflection-activator-createinstance As for the above suggestion to use Microsoft.Data.Sqlite, please note that EF Core 8 seems to have missed the target to introduce experimental NativeAOT support but that the underlying Microsoft.Data.Sqlite does support it. So, as long as it's good enough to have "only" the core library and not go full EF Core, you're good to go. |
When compiling to native AOT, I get the following:
Unhandled Exception: System.MissingMethodException: No parameterless constructor defined for type 'MyClass'.
I didn't do anything fancy, just created a table, so should be easy to reproduce.
The text was updated successfully, but these errors were encountered: