RDCore.Runtime.Hosting 0.2.11-alpha

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

RDCore.Runtime.Hosting

NuGet

<sup>Ce document est disponible en français</sup>

What a host runs an RD-VBA program with: the composition rdc compose wrote, loaded with no parser, and the machines that run it. It implements the runtime hosting contract of RDCore.SDK (RDCore.SDK.Runtime.Hosting).

This is a pre-alpha. The API and the composition format can change, and a platform reads only the compositions of its own format.

Composing a program

rdc compose parses a workspace, binds and defines its symbols, and writes what it defined to a composition file: bin/<configuration>/<project>.rdcomposition, or the file --output names. The descriptions of the libraries the project references go in the Symbols folder beside it. A module that does not parse or load is reported, and nothing is written.

rdc compose C:\Projects\NavalBattle --configuration Release

Deploy the composition file and its Symbols folder with the host. The source files are not needed.

Running it

await using var program = await ComposedProgramFile.LoadAsync(@"bin\Release\NavalBattle.rdcomposition");
await using var machine = await program.CreateMachineAsync(cancellationToken);
var result = await machine.InvokeAsync(new ProgramInvocation("Program", "Total", arguments), cancellationToken);
Member What it does
ComposedProgramFile.LoadAsync Reads the composition. Throws InvalidDataException for a file that is not one, or for a composition of another format.
IComposedProgram.Documents The program's files, each with its parse, as they were when the program was composed.
IComposedProgram.CreateMachineAsync Makes a machine: a runtime session of its own, composed from the composition. Machines can be made concurrently, and run at the same time, each on its own thread.
IProgramMachine.InvokeAsync Runs one procedure by name, with its arguments and its result as JSON. A procedure of a class whose VB_PredeclaredId is True runs on the class's default instance, which keeps its state from one invocation to the next until the program sets it to Nothing or the machine is reset. A procedure of any other class module runs on a new object of the class: its Class_Initialize runs before the procedure, and its Class_Terminate once the procedure returns. An unhandled error or an End ends the run, and the run's end lets go of the object. A machine runs one invocation at a time. A cancelled invocation ends as Interrupted, and an End statement as Halted.
IProgramMachine.ResetAsync Puts the machine's session back in the state the program was composed in.
IProgramMachine.DisposeAsync Releases the machine's session, once any invocation that is running ends. It can be called more than once.

Disposing the program disposes none of its machines.

Libraries of extensions

A project can reference a library that an extension of the platform provides. rdc compose writes its description in Symbols with the others, and the composition names it, but its code is not in the composition: the host gives it. ComposedProgramOptions.ExtensionLibraries lists each library with the factory that makes its provider in every machine's session (LoadedExtensionLibrary, of RDCore.SDK). LoadAsync throws InvalidOperationException, naming the library, for a composition that names a library the host does not give.

A call of an invocation (ProgramCall) can name a standard module of such a library as Library.Module, and a hook (ProgramHookCall) an interface of the library as Library.Interface: a class of the program that implements it runs as the hook. An object of a class of the library becomes, in a result, a JSON object of the Public Property Gets its library describes, and Nothing becomes null. Only the library makes its objects: a JSON argument never becomes one.

The outside world

A machine makes its forms, the objects of automation servers and its native calls in an external host, a process started the first time a machine needs it. ComposedProgramOptions.ExternalHost names its executable: rdc, run in external mode as rdc run runs a program, or the host itself. It is the rdc beside the host's own assemblies when it is not given.

A host that deploys no rdc is its own external host, as a built program is. Its Main runs as the external host when it was started as one, and names its own executable:

public static int Main(string[] args)
{
    if (ProgramExternalHost.IsThisProcess)
    {
        return ProgramExternalHost.Run(args);
    }

    var options = new ComposedProgramOptions { ExternalHost = ProgramExternalHost.Executable };
    // load the program with the options, and run the host
}

ProgramExternalHost.Executable is null for a host run with dotnet, whose executable cannot run as an external host: its machines then start the rdc beside the host's own assemblies. Forms are made in RDForms on every operating system. Automation servers and native calls work on Windows only.

Licence

GPL-3.0-or-later. The package holds no parser: a host that references it runs a program from its composition alone.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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.2.11-alpha 0 11/29/2026
0.2.10-alpha 0 11/29/2026
0.2.9-alpha 0 11/29/2026
0.2.8-alpha 0 11/29/2026