A lightweight C# scripting engine built on Roslyn, designed for embedding safe, extensible, and stateful scripting into your applications.
- Execute C# scripts at runtime
- Strongly‑typed globals
- Shared state across script executions
- Structured results (return value, exception, diagnostics)
- Minimal dependencies
- MIT licensed
dotnet add package SimpleScriptingServiceOr via the NuGet Package Manager:
Install-Package SimpleScriptingService
var engine = new ScriptEngine();var result = await engine.ExecuteAsync("1 + 2");
Console.WriteLine(result.ReturnValue); // 3- Executes scripts asynchronously
- Accepts optional globals
- Provides access to shared state
- Strongly‑typed object exposed to scripts
- Extend this class to expose your own API surface
- Provides
Logmethod
Dictionary<string,object>storage shared across script runs
ReturnValueErrorValueIsSuccess
MIT License — free for commercial and open‑source use.