<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/writing-node-js-addons-with-net-native-aot-lseoiscpd" -->

---
title: Writing Node.js addons with .NET Native AOT | daily.dev
description: The C# Dev Kit team replaced C++ Node.js addons (built with node-gyp and requiring Python) with C# using .NET Native AOT. The post walks through building a...
canonical: https://daily.dev/posts/writing-node-js-addons-with-net-native-aot-lseoiscpd
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Writing Node.js addons with .NET Native AOT | daily.dev
og:description: The C# Dev Kit team replaced C++ Node.js addons (built with node-gyp and requiring Python) with C# using .NET Native AOT. The post walks through building a...
og:url: https://daily.dev/posts/writing-node-js-addons-with-net-native-aot-lseoiscpd
og:image: https://api.daily.dev/og/posts/LSeOiScpD.png
og:image:alt: Writing Node.js addons with .NET Native AOT
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Writing Node.js addons with .NET Native AOT

**[.NET Blog](https://daily.dev/sources/dotnet)** · 10 min read · 41 upvotes · 3 comments

## Summary

The C# Dev Kit team replaced C++ Node.js addons (built with node-gyp and requiring Python) with C# using .NET Native AOT. The post walks through building a Node.js native addon in C# using N-API, covering the project setup, module entry point with [UnmanagedCallersOnly], P/Invoke via [LibraryImport] with a custom DLL resolver pointing to the host process, UTF-8 string marshalling using Span<T> and ArrayPool, and exposing functions to TypeScript. The result eliminated the Python dependency, simplified CI pipelines, and matched C++ performance while opening the door to hosting .NET logic in-process within Node.js.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://devblogs.microsoft.com/dotnet/writing-nodejs-addons-with-dotnet-native-aot/>

## Community discussion

Top comments from developers on daily.dev.

**@germancarlossuarez** · 4 upvotes

> Great advance!!!

**@sevensolutions** · 3 upvotes

> Very interesting article 😁

## Similar posts on daily.dev

- [Node Weekly Issue 621: April 23, 2026](https://daily.dev/posts/node-weekly-issue-621-april-23-2026-z0ag9h21x) · Node Weekly · 3 upvotes · 0 comments
- [Making Reflection Native AOT Safe in .NET 10: DynamicallyAccessedMembers Guide](https://daily.dev/posts/making-reflection-native-aot-safe-in-net-10-dynamicallyaccessedmembers-guide-xpy12bjep) · We Are .NET · 3 upvotes · 0 comments
- [Full-Stack Type Safety Across Languages with @nx/dotnet](https://daily.dev/posts/full-stack-type-safety-across-languages-with-nx-dotnet-ka8begadt) · Nx · 1 upvotes · 0 comments

---

Tags: [#nodejs](https://daily.dev/tags/nodejs), [#c#](https://daily.dev/tags/c#)

[View this post on daily.dev](https://daily.dev/posts/writing-node-js-addons-with-net-native-aot-lseoiscpd)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Writing Node.js addons with .NET Native AOT","url":"https://daily.dev/posts/writing-node-js-addons-with-net-native-aot-lseoiscpd","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/writing-node-js-addons-with-net-native-aot-lseoiscpd"},"datePublished":"2026-04-20T20:00:57.105Z","dateModified":"2026-04-20T20:01:24.414Z","description":"The C# Dev Kit team replaced C++ Node.js addons (built with node-gyp and requiring Python) with C# using .NET Native AOT. The post walks through building a...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3ba5c0dc0b9d3ec9247fc2559cf9141b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/3ba5c0dc0b9d3ec9247fc2559cf9141b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":".NET Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":".NET Blog","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/f23eb59371bd4f07aeef64c4eef73266","url":"https://daily.dev/sources/dotnet"},"commentCount":3,"discussionUrl":"https://daily.dev/posts/writing-node-js-addons-with-net-native-aot-lseoiscpd","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":41},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":3}],"keywords":"nodejs,c#","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":".NET Blog","item":"https://daily.dev/sources/dotnet"},{"@type":"ListItem","position":3,"name":"Writing Node.js addons with .NET Native AOT"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/writing-node-js-addons-with-net-native-aot-lseoiscpd","comment":[{"@type":"Comment","text":"Great advance!!!","datePublished":"2026-04-21T15:14:55.660Z","url":"https://daily.dev/posts/LSeOiScpD#c-0wQY0IWxY","author":{"@type":"Person","name":"German Carlos Suarez","url":"https://daily.dev/germancarlossuarez","image":"https://lh3.googleusercontent.com/a/ACg8ocLmkjKXwimeDCxdmBrULMyymVyRjcJ2QNtHmeiMZv9KuQ_UxA=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4}},{"@type":"Comment","text":"Very interesting article 😁","datePublished":"2026-04-21T18:29:55.855Z","url":"https://daily.dev/posts/LSeOiScpD#c-aaItaSu5e","author":{"@type":"Person","name":"Daniel Peinhopf","url":"https://daily.dev/sevensolutions","image":"https://avatars.githubusercontent.com/u/84123899?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}}]}
```

