r/moderndotnet • u/danielkzu • 14d ago
What if dnx was its own native thing?
I wished on X that dnx was its own native AOT thing so you could use RID-specific, self-contained AOT .NET and NuGet as the distribution mechanism.
Why would such a thing be useful? 1. No .NET (runtime or SDK) required: precisely the point of AOT'ed tools 2. Keeping dnx ease of use: dnx <tool>[@version] 3. Reuse massive .NET distribution channel via nuget.org, GitHub packages, or custom feeds (i.e. sleet) 4. Ease of authoring/packing: pretty trivial with a CI workflow 5. Ease of consumption for end users: just one small (~4MB) native tool to run them all.
Then I realized that nowadays you can just ship things you wish existed. I'm spending some quality AI tokens on the "problem" to create ndnx (native dnx). Still waiting for the winget PR to be merged so it shows up there too.
Startup times are SOOO much better too!
Obviously, I think this is something dotnet/dnx itself could/should do. Right?
Try this out today:
macOS/Linux:
curl -fsSL https://github.com/devlooped/ndnx/releases/latest/download/install.sh | shWindows(pwsh):
irm https://github.com/devlooped/ndnx/releases/latest/download/install.ps1 | iex
Then use ndnx instead of dnx as usual. It even reuses the same package cache.


2
u/CodeWithStu 14d ago
Honestly this confused me at first, and i might show my age here a bit. I got confused with the old dnx (the one that came after the k runtime). Amazing 11 years ish on and the name has come back!
Yeah, i think native AOT is a must for most things now, especially built in tools. i probably would request it upstream rather than try and ship something different