RuleScript.Core 1.10.1

dotnet add package RuleScript.Core --version 1.10.1
                    
NuGet\Install-Package RuleScript.Core -Version 1.10.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RuleScript.Core" Version="1.10.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RuleScript.Core" Version="1.10.1" />
                    
Directory.Packages.props
<PackageReference Include="RuleScript.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RuleScript.Core --version 1.10.1
                    
#r "nuget: RuleScript.Core, 1.10.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RuleScript.Core@1.10.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RuleScript.Core&version=1.10.1
                    
Install as a Cake Addin
#tool nuget:?package=RuleScript.Core&version=1.10.1
                    
Install as a Cake Tool

RuleScript

Build Stable Version NuGet Version NuGet Downloads

RuleScript is a lightweight, embeddable .NET 8 scripting engine for rule-oriented workflows, automation, validation, JSON processing, and host-controlled execution.

It provides a lexer, parser, AST, interpreter, built-in functions, user functions, project imports, Host Function integration, HostTrigger runtimes, runtime diagnostics, and debugger APIs without exposing a full general-purpose programming language.

Installation

Install the stable package from NuGet:

dotnet add package RuleScript.Core --version 1.10.1

Quick Start

using RuleScript.Core.Runtime;

var engine = new RuleScriptEngine();
var context = new RuntimeContext();

context.Set("Name", "Mick");
context.Set("Distance", 519);

engine.Execute("""
    var message = "Hello " + Name;

    if Distance > 500 then:
        result = message + ": NG";
    else:
        result = message + ": OK";
    endif
    """, context);

Console.WriteLine(context.Get<string>("result"));

Run a project file:

var engine = new RuleScriptEngine
{
    WorkingDirectory = @"C:\rules"
};

var context = engine.ExecuteFile("main"); // Resolves main.rules

Register a Host Function:

engine.RegisterFunction("GetDistance", _ => 519);

var context = engine.Execute("result = GetDistance();");

Start a long-running HostTrigger runtime:

var engine = new RuleScriptEngine
{
    ExecutionTimeoutEnabled = false
};

var runtime = engine.CreateRuntime("""
    @HostTrigger("LotArrived")
    function OnLotArrived(lotId: string) -> void:
        Print("lot arrived: " + lotId);
        return;
    endfunction

    parallel:
        trigger task:
            dispatch;
        endtask
    endparallel
    """);

var running = runtime.StartAsync();

await runtime.TriggerAsync("LotArrived", ["LOT-001"]);
await runtime.StopAsync();
await running;

Documentation

Detailed syntax, Host integration, debugging, analysis, and version-specific behavior are maintained in the RuleScript Wiki.

Development

The latest stable source is available on main. See the v1.10.1 release notes for source-file-aware analysis imports. See the v1.10.0 release notes for HostTrigger runtimes and long-running dispatch.

dotnet build RuleScript.sln
dotnet test RuleScript.sln

License

RuleScript is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.10.1 169 7/8/2026
1.10.0 114 7/7/2026
1.10.0-rc1.5 66 7/7/2026
1.10.0-rc1.4 63 7/7/2026
1.10.0-rc1.3 72 7/7/2026
1.10.0-rc1.2 61 7/7/2026
1.10.0-rc1.1 72 7/7/2026
1.10.0-rc1.0 79 7/7/2026
1.9.0 100 7/6/2026
1.9.0-rc1.1 65 7/6/2026
1.9.0-rc1.0 62 7/6/2026
1.8.0 103 7/6/2026
1.8.0-preview1.0 57 7/4/2026
1.7.0 103 7/3/2026
1.7.0-rc1.1 70 7/3/2026
1.7.0-rc1.0 66 7/3/2026
1.6.0 102 7/3/2026
1.6.0-rc1.4 59 7/3/2026
1.6.0-rc1.3 55 7/3/2026
1.6.0-rc1.2 70 7/3/2026
Loading failed