Microsoft Replaces C++ Node.js Addons with C# and .NET Native AOT in C# Dev Kit
Breaking: C# Dev Kit Eliminates Python Dependency for Native Addons
Microsoft's C# Dev Kit team has overhauled their Node.js native addon build process, replacing C++ modules with C# code compiled via .NET Native AOT. The move eliminates the need for Python and node-gyp, a long-standing pain point for developers.

“We already have the .NET SDK installed, so using C# and Native AOT to streamline our engineering systems was a natural step,” said a Microsoft engineer familiar with the project. “This removes an entire class of setup friction for contributors and CI pipelines.”
Background: The old way
Historically, the C# Dev Kit extension used native Node.js addons written in C++ for platform-specific tasks like reading the Windows Registry. These addons were compiled with node-gyp, which requires an old version of Python on every developer machine.
For a team focused on .NET tooling, that Python dependency added significant overhead. New contributors had to install tools they’d never use directly, and CI pipelines spent extra cycles provisioning and maintaining Python environments.
How .NET Native AOT simplifies the process
Node.js native addons are shared libraries (.dll, .so, or .dylib) that export a specific entry point called napi_register_module_v1. The N-API (Node-API) interface is language-agnostic—it only requires the library to export the right symbols.
.NET Native AOT can produce such shared libraries from C# code. The new addon project file is minimal:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<PublishAot>true</PublishAot>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
</Project>
The PublishAot flag tells the SDK to emit a shared library, while AllowUnsafeBlocks permits the function pointers and fixed buffers that N-API interop requires. The entry point is defined with [UnmanagedCallersOnly] attribute.

What This Means
Developers using the C# Dev Kit will no longer need to install Python or manage a separate C++ build chain. This reduces setup time for new contributors and simplifies CI/CD configurations.
More broadly, this demonstrates that .NET Native AOT can serve as a viable alternative to C++ for building Node.js native addons. Teams already invested in the .NET ecosystem can leverage their existing skills and tooling without sacrificing performance.
“This is a win for developer productivity,” the engineer added. “We get the same native performance with fewer dependencies and a unified build pipeline.”
Looking ahead
Microsoft plans to continue refining the approach and is evaluating whether to open-source the pattern for other teams to adopt. The move could encourage broader adoption of .NET Native AOT for cross-platform native extensions in the Node.js ecosystem.
For now, the C# Dev Kit team recommends that .NET shops explore Native AOT documentation as a starting point for similar migrations.
Related Articles
- Modernizing Go Code with go fix: A Complete Guide
- 10 Insider Facts About the Python Security Response Team's New Era
- 10 Key Insights into the Lomiri Tech Meeting: A Free Open Source Mobile Dev Hackathon in the Netherlands
- Designers Ditch Adobe and Figma: Claude Design Sparks Industry Shift
- When APIs Are Not Enough: The Clash Between Kernel Improvements and TCMalloc's Reliance on Undocumented Behavior
- Mastering Multi-Agent AI Collaboration at Scale
- Modernizing Go Code with Source-Level Inlining and the New Go Fix
- Python Packaging Gains Formal Governance Council with PEP 772 Approval