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

NativeAoT support #107

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

Getup98
Copy link

@Getup98 Getup98 commented Jan 19, 2025

Closes #56

Removing code when "AOT_ENABLED" is set is no longer necessary with .net9.0, thanks to Intrinsic APIs marked RequiresDynamicCode now including MethodInfo.MakeGenericMethod.

I annotated the entire library (and tests) with the required attributes and provided overloads that don't require dynamically accessed code to the few methods that still require it (mostly due to json serialization).

Also made Backdash.Analyzers compatible with visual studio on the way, for convenience.

Tests succeed both with and without PublishAoT, the Godot sample also exports and plays with PublishAoT with a single minimal change: the export setting "Embed Build Outputs" makes it crash on startup.

@Getup98
Copy link
Author

Getup98 commented Jan 19, 2025

I forgot i had to do it, but to make the Godot sample work with PublishAoT another necessary change is to the json serialization used to communicate with the lobby server, have it use JsonTypeInfos (or JsonSerializerContext source generation) instead of reflection.

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

Successfully merging this pull request may close these issues.

AOT Support
1 participant