Remove newtonsoft, make the library native aot compatible
@Tr00d is already working on this.
Since Jul 1, 2026.
Assessment
This issue has not been assessed yet.
Description
Chore
Describe the chore
Bring supabase-csharp (and the sub-packages we use) up to .NET Native AOT so a dotnet publish -c Release -p:PublishAot=true build succeeds, and there are no runtime errors.
Acceptance criteria
- AOT publish finishes without linker errors or reflection warnings.
- App boots and runs basic Supabase flows (auth, simple CRUD) in the published binary.
- CI job produces an AOT artifact.
Steps
-
Add a repo-level
Directory.Build.propswith:<Project> <PropertyGroup> <PublishAot>true</PublishAot> <PublishTrimmed>true</PublishTrimmed> <InvariantGlobalization>true</InvariantGlobalization> <EnableDynamicLoading>false</EnableDynamicLoading> </PropertyGroup> </Project> -
Swap Newtonsoft.Json for
System.Text.Json+ source-generated context. -
Mark
BaseModelwithDynamicallyAccessedMembersand tag helper methods that use reflection withRequiresUnreferencedCode. -
Replace
Activator.CreateInstancecalls withnew T(). -
Run:
dotnet restore dotnet build -c Release dotnet publish -c Release -p\:PublishAot=true -p\:SelfContained=true -o ./aotFix any remaining trim warnings.
-
Update CI pipeline to run the publish step and cache the output.
Additional context
Reference the detailed checklist in docs/aot-supabase-notes.md.
- Dominant language
- C#
- Stars
- 701
- Forks
- 106
- Avg merge
- 16h 35m
- Merged PRs (30d)
- 45
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/supabase-csharp
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
supabase/supabase-csharp#440 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
supabase/supabase-csharp#437 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
supabase/supabase-csharp#427 ·
-
supabase/supabase-csharp#409 · 1 comment · 1 assignee ·
-
area: realtime bug parity
supabase/supabase-csharp#393 · 1 assignee ·
All issues in supabase/supabase-csharp
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100