Natasha lets .NET applications compile and load C# at runtime using Roslyn. It adds domain and plugin management with isolation, unload, and hot-swap.
Overview
Natasha is a Roslyn-based library for building domains, assemblies, classes, structs, enums, interfaces, and methods from C# source while an application is running. That allows adding modules and behavior without restarting the host process.
The library integrates domain and plugin management so workloads can use domain isolation, domain unloading, and hot plug-in style updates. Compilation follows a full pipeline with error reporting, automatic reference resolution, and templates for common data structures.
Developers consume it through NuGet packages such as the C# compiler and optional domain modules for newer .NET versions. A chain-style API is intended to keep focus on the scripts being compiled rather than boilerplate setup.
Documentation and FAQ cover initialization and typical compilation flows. The library targets netstandard2.0 and newer .NET Core application versions and runs cross-platform.
Key features
- Runtime Roslyn C# compilation
- Domains, assemblies, types, and methods
- Domain isolation and unload
- Hot-swappable plugin management
- Automatic reference handling
- Structured build templates
- Chain-style API
- Cross-platform .NET support
Use cases
- Runtime-loaded business rules in .NET apps
- Hot-reloadable plugin architectures
- Scripted extensions without separate processes
- Isolated compilation domains for untrusted code
- Dynamic module delivery in long-running services