Novolis.CodeGen.Bindings.Roslyn
2026.1.2.53
dotnet add package Novolis.CodeGen.Bindings.Roslyn --version 2026.1.2.53
NuGet\Install-Package Novolis.CodeGen.Bindings.Roslyn -Version 2026.1.2.53
<PackageReference Include="Novolis.CodeGen.Bindings.Roslyn" Version="2026.1.2.53" />
<PackageVersion Include="Novolis.CodeGen.Bindings.Roslyn" Version="2026.1.2.53" />
<PackageReference Include="Novolis.CodeGen.Bindings.Roslyn" />
paket add Novolis.CodeGen.Bindings.Roslyn --version 2026.1.2.53
#r "nuget: Novolis.CodeGen.Bindings.Roslyn, 2026.1.2.53"
#:package Novolis.CodeGen.Bindings.Roslyn@2026.1.2.53
#addin nuget:?package=Novolis.CodeGen.Bindings.Roslyn&version=2026.1.2.53
#tool nuget:?package=Novolis.CodeGen.Bindings.Roslyn&version=2026.1.2.53
Novolis.CodeGen.Bindings.Roslyn
Roslyn hook host, default binding-job runner, emit writer, and structural compilation-unit comparison for C-ABI binding codegen.
Install
dotnet add package Novolis.CodeGen.Bindings.Roslyn
Prerequisites: .NET 10 SDK (net10.0).
Quick start (no hooks)
Most C libraries only need typed manifests and jobs — no phase enum and no CreateContext plumbing:
using Novolis.CodeGen.Bindings;
using Novolis.CodeGen.Bindings.Roslyn;
var options = BindingCodegenOptions.Physical(
repoRoot,
manifests,
"dotnet run --project My.CodeGen -- generate");
var project = BindingProject.Create("MyLib")
.AddJob(BindingEmitJob.LibraryImport(
"interop",
fragmentId: "mylib",
className: "MyLibNative",
relativePath: "src/MyLib.Bindings/Interop/MyLibNative.g.cs",
namespaceName: "MyLib.Interop",
assemblyName: "MyLib.Bindings",
libraryConstantName: "MyLibDll"))
.AddJob(BindingEmitJob.FacadeForward(
"facade",
fragmentId: "facades",
typeName: "AudioDevice",
relativePath: "src/MyLib.Runtime/Audio/AudioDevice.g.cs",
namespaceName: "MyLib",
assemblyName: "MyLib.Runtime",
facadeMethodImpl: "AggressiveInlining"));
var exit = BindingCodegen.Generate(project, options);
See the TinyExpr lab for a complete tiny consumer:
d:\novolis\novolis-lab\labs\codegen\TinyExprBindings\.
Custom phases and hooks
Raylib-style consumers that rewrite syntax after emit still use the generic host:
var exit = new BindingCodegenHost<MyPhase, MyContext>().Generate(
new BindingCodegenRun<MyPhase, MyContext>
{
Project = project,
Options = options,
SelectPhase = job => MyPhase.Emit,
CreateContext = (job, fragment, outputPath, fingerprint) =>
new MyContext
{
Environment = options.Environment,
OutputPath = outputPath,
Fragment = fragment,
ManifestSha256 = fingerprint,
RegenerateHint = options.RegenerateHint,
},
Hooks = HookDiscovery.Discover<MyPhase, MyContext>(typeof(MyEndDrawingHook).Assembly),
});
Jobs own their source-format policy: RoslynFormatter for interop, shims, and debug output; NormalizeWhitespace for façade forwards (applied automatically by BindingEmitJob.FacadeForward). Use CompilationUnitComparer.AreStructurallyEquivalent for T1 parity gates between committed and emitted source.
Related packages
| Package | When to use |
|---|---|
Novolis.CodeGen.Bindings |
Manifest fragments, BindingEmitJob factories, and emit orchestration |
More documentation
Support
Pre-release platform library. Depends on Microsoft.CodeAnalysis.CSharp.
| Product | Versions 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. |
-
net10.0
- Microsoft.CodeAnalysis.CSharp (>= 5.9.0)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 5.9.0)
- Novolis.CodeGen.Bindings (>= 2026.1.2.53)
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 |
|---|---|---|
| 2026.1.2.53 | 81 | 10/18/2026 |
| 2026.1.2.51 | 98 | 10/18/2026 |
| 2026.1.2.50 | 96 | 10/4/2026 |
| 2026.1.2.49 | 96 | 10/4/2026 |
| 2026.1.2.48 | 112 | 10/1/2026 |
| 2026.1.2.47 | 95 | 9/30/2026 |