RDCore.Runtime.Hosting
0.2.11-alpha
dotnet add package RDCore.Runtime.Hosting --version 0.2.11-alpha
NuGet\Install-Package RDCore.Runtime.Hosting -Version 0.2.11-alpha
<PackageReference Include="RDCore.Runtime.Hosting" Version="0.2.11-alpha" />
<PackageVersion Include="RDCore.Runtime.Hosting" Version="0.2.11-alpha" />
<PackageReference Include="RDCore.Runtime.Hosting" />
paket add RDCore.Runtime.Hosting --version 0.2.11-alpha
#r "nuget: RDCore.Runtime.Hosting, 0.2.11-alpha"
#:package RDCore.Runtime.Hosting@0.2.11-alpha
#addin nuget:?package=RDCore.Runtime.Hosting&version=0.2.11-alpha&prerelease
#tool nuget:?package=RDCore.Runtime.Hosting&version=0.2.11-alpha&prerelease
RDCore.Runtime.Hosting
<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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Avalonia.Desktop (>= 12.0.5)
- Avalonia.Headless (>= 12.0.5)
- RDCore.Forms (>= 0.1.7-alpha)
- RDCore.SDK (>= 0.2.8-alpha)
- TestableIO.System.IO.Abstractions.TestingHelpers (>= 22.2.0)
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 |