dotnetcore/Natasha
基于 Roslyn 的 C# 动态程序集构建库,该库允许开发者在运行时使用 C# 代码构建域 / 程序集 / 类 / 结构体 / 枚举 / 接口 / 方法等,使得程序在运行的时候可以增加新的模块及功能。Natasha 集成了域管理/插件管理,可以实现域隔离,域卸载,热拔插等功能。 该库遵循完整的编译流程,提供完整的错误提示, 可自动添加引用,完善的数据结构构建模板让开发者只专注于程序集脚本的编写,兼容 stanadard2.0 / netcoreapp3.0+, 跨平台,统一、简便的链式 API。 且我们会尽快修复您的问题及回复您的 issue. observed · 2026-08-28
Health v2 · maintenance only
67/100
- Activity 74
- Release rhythm 40
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: 0.0
- age_days: 3471
- days_rel: 658
- days_push: 156
- n_releases_24m: 3
Adoption not part of the score
1586 stars · 232 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
Natasha is a Roslyn-based C# dynamic assembly building library that lets developers compile and load C# code at runtime, creating domains, assemblies, classes, structs, enums, interfaces, and methods on the fly. It includes domain and plugin management with domain isolation, unloading, and hot-swapping, plus a fluent chain API, automatic reference handling, and full compilation error reporting.
Use cases
- compile and run C# code dynamically at runtime
- build a plugin system with hot-swappable C# modules
- isolate and unload dynamically loaded assemblies
- generate classes and methods from C# source strings on the fly
- implement scripting support inside a .NET application
- load new features into a running program without restarting
- manage collectible AssemblyLoadContext domains in .NET
When to choose
- you need runtime C# compilation with a clean fluent API on .NET Core / .NET Standard 2.0+
- you want plugin management with domain isolation, unloading, and hot-swapping
- you need automatic reference resolution and detailed compiler diagnostics for generated code
- you want a cross-platform, actively maintained alternative to raw Roslyn scripting
When to avoid
- you only need simple configuration-driven behavior that static code or dependency injection can handle
- your target is .NET Framework (pre-Core) rather than netstandard2.0 / netcoreapp3.0+
- you need dynamic compilation in a non-C# .NET language like F# or VB
- you cannot tolerate the overhead or security surface of compiling code at runtime
Facets
library · maturity active
compiler plugin-system interpreter developer-tools developer-tools compilers programming-languages dotnet cross-platform windows roslyn csharp dynamic-compilation runtime-code-generation scripting assembly-building hot-reload assembly-unloading domain-isolation chain-api plugins linux macos
3 sources
- readme: https://github.com/dotnetcore/Natasha · fetched 2026-08-28 · 3e77c3f2f07e
- homepage: https://natasha.dotnetcore.xyz/ · fetched 2026-08-29 · dd671d65153c
- site_page: https://natasha.dotnetcore.xyz/docs · fetched 2026-08-29 · 347870972152
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| dotnetcore/Natasha | main | 67 |
For agents
markdown · JSON · MCP: product_card(name="dotnetcore/Natasha")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem