Jroc.Core 0.12.26

dotnet add package Jroc.Core --version 0.12.26
                    
NuGet\Install-Package Jroc.Core -Version 0.12.26
                    
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="Jroc.Core" Version="0.12.26" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jroc.Core" Version="0.12.26" />
                    
Directory.Packages.props
<PackageReference Include="Jroc.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 Jroc.Core --version 0.12.26
                    
#r "nuget: Jroc.Core, 0.12.26"
                    
#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 Jroc.Core@0.12.26
                    
#: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=Jroc.Core&version=0.12.26
                    
Install as a Cake Addin
#tool nuget:?package=Jroc.Core&version=0.12.26
                    
Install as a Cake Tool

Jroc.Core

Jroc.Core provides in-memory JavaScript compilation for .NET applications whose scripts are not known at build time. It ships Jroc.Compiler.dll and the compiler dependencies.

The consumer entry point is Jroc.JrocInMemoryCompiler: compile runtime source to PE/PDB bytes, or compile and evaluate it in a disposable in-memory module.

Choose your workflow

  • jroc: compile and run from the command line.
  • Jroc.SDK: compile known JavaScript during MSBuild, then call the generated assembly's typed Import / Run APIs.
  • Jroc.Core: compile scripts supplied at runtime in memory.

Jroc.Runtime supplies execution support. Official releases publish all four packages together; keep versions aligned when using them in one application.

Install

For a .NET 10 application that compiles and executes runtime-supplied scripts:

<ItemGroup>
  <PackageReference Include="Jroc.Core" Version="VERSION" />
  <PackageReference Include="Jroc.Runtime" Version="VERSION" />
</ItemGroup>

Replace VERSION with the same released version for both packages.

Compile and execute in memory

using Jroc;

// Replace with source selected by the application at runtime.
var sourceText = "exports.add = (left, right) => left + right;";
var path = Path.Combine(Path.GetTempPath(), "jroc-input", "math.js");

using var module = JrocInMemoryCompiler.CompileAndLoadModule(
    new JrocInMemoryCompileRequest(path) { SourceText = sourceText });

Console.WriteLine(module.Exports.Invoke("add", 1d, 2d));

The entry path supplies identity and dependency-resolution context. It need not exist when SourceText is provided. Omitting SourceText reads an existing entry file while still emitting and loading the generated assembly in memory.

module.Exports supports Get, Invoke, Value, and C# dynamic access. Dispose the module when finished; it owns the execution runtime and collectible load context. Keep it alive until any required async work settles. No generated output files are written implicitly.

In-memory execution is not a sandbox. Only execute trusted scripts in the host process.

Artifact-only compilation

Use JrocInMemoryCompiler.Compile(request) when the application needs JrocCompiledAssemblyArtifact.PeBytes and optional PdbBytes without evaluating the script. Set EmitPdb on the request for debug symbols, AssemblyName for a custom identity, and DiagnosticFilePath to capture compiler diagnostics.

For JavaScript known at build time, prefer Jroc.SDK and generated typed contracts rather than embedding compiler services in application code.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

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
0.12.26 49 9/19/2026
0.12.25 51 9/18/2026
0.12.24 59 9/18/2026
0.12.23 85 9/16/2026
0.12.22 85 9/16/2026
0.12.21 110 9/9/2026
0.12.20 98 9/8/2026
0.12.19 111 9/8/2026
0.12.18 108 9/2/2026
0.12.17 92 9/2/2026
0.12.16 100 9/1/2026
0.12.15 109 8/30/2026
0.12.14 127 8/23/2026
0.12.13 116 8/21/2026
0.12.12 116 8/21/2026
0.12.11 118 8/19/2026
0.12.10 115 8/18/2026
0.12.9 121 8/18/2026
0.12.8 127 8/17/2026
0.12.7 128 8/16/2026
Loading failed