Releases: peacefulstudio/daml-codegen-csharp
Release list
v0.1.8-preview.5
This release follows 0.1.8-preview.4. The headline is a codegen serialization-dispatch fix: generated serialization no longer emits a non-compiling .ToRecord() for variant payloads or for fields the type mapper cannot name, so an --include-dependencies tree containing Daml stdlib types like DA.Logic.Types.Formula, DA.Action.State.Type.State and DA.Monoid.Types.Endo now compiles as a single assembly. This release also bumps the default Splice release to 0.6.9 and regenerates both the Splice and Daml Finance C# bindings with the preview.5 emitter.
Changes since 0.1.8-preview.4
Changed
- Generated code and runtime messages no longer embed internal issue-tracker references; limitation notes (contract-key projection, generic-type serialization) now read as generic, consumer-facing prose.
Fixed
- Generated serialization no longer emits a non-compiling
.ToRecord()for variant payloads or for fields the type mapper cannot name. Variant payloads (including recursive variants such asDA.Logic.Types.Formulaand variant payloads nested in lists) now serialize viaToVariant()/FromVariant(), and function-typed / otherwise-unmappable fields (e.g.DA.Action.State.Type.State,DA.Monoid.Types.Endo) emit theGenericStub.NotImplementedstub instead of a missing-method call. Compiling an--include-dependenciestree containing these Daml stdlib types as one assembly no longer fails withCS1061.
What's included
| Package | Purpose |
|---|---|
Daml.Codegen.CSharp |
the C# emitter library |
Daml.Runtime |
runtime types referenced by generated code |
Daml.Ledger.Abstractions |
transport-agnostic ILedgerClient submission/subscription interface |
Daml.Codegen.Testing.Conformance |
compiled conformance corpus + embedded DAR for live-ledger round-trip tests |
The four core packages are versioned in lockstep and published to NuGet.org. The codegen CLI ships separately as a multi-arch OCI component for dpm — oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.5 (linux/amd64, linux/arm64, darwin/arm64, windows/amd64); the per-RID bundle tarballs and all .nupkg/.snupkg files are attached below.
Generated DAR bindings (NuGet.org)
Generated C# bindings built with this release are published to NuGet.org and attached here:
- Daml Finance 2.10.0 — 8 packages (
Daml.Finance.*, e.g.Daml.Finance.Util.V4 4.0.0-preview.5). Regenerated with the preview.5 emitter; the keyed-template andDayOfWeek/Periodfixes from preview.4 mean the previously-broken keyed and date packages now compile. - Splice 0.6.9 — 23 packages (
Splice.*, e.g.Splice.Amulet 0.1.20-preview.5). Bumped from 0.6.5; the new 0.6.9 packages (batched-markers, featured-app proxies, token-standard wallet, app-manager) are picked up automatically.
Versioning and stability
This project is pre-1.0: under SemVer 0.x, any release may change the public API without a major-version bump. This is a preview release.
Getting started
Add the codegen component to your daml.yaml (set DPM_AUTO_INSTALL=true so dpm fetches it on first use):
components:
- oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.50.1.8-preview.4 — interface-only read path; Daml Finance + Splice codegen unblocked
This release supersedes 0.1.8-preview.3, which was published to NuGet.org and then unlisted before general use because of a mandatory codegen fix. 0.1.8-preview.4 contains everything from preview.3 plus the preview.4 changes below — if you were on preview.2, this is the next release to take.
The headline is the interface-only read path — read-path helpers now accept Daml interface markers, not just templates, and match created contracts by interface view — and the codegen fixes that unblock the generated Daml Finance and Splice C# packages (the Key-accessor revert, the DayOfWeek stdlib mapping, the Period/CS0542 and sibling-version/NU1102 fixes). Generated Daml Finance 2.10.0 (8 packages) and Splice 0.6.5 (22 packages) C# bindings are published to GitHub Packages and attached to this release.
Changes since 0.1.8-preview.2
Added
- Read-path helpers now accept Daml interface markers, not just templates, and match created contracts by interface view. The generic constraint on
TransactionResultExtensions.Single<T>/TrySingle<T>/All<T>,ILedgerClient.TryExerciseForCreatedAsync<TTemplate>and bothSubscribeAsync<T>overloads, andContractStreamEvent<T>is relaxed fromITemplatetoIDamlType. WhenTis a template the match is unchanged (created contract'sTemplateId); whenTis an interface marker (IDamlInterface), a created contract matches when itsInterfaceIdscontainsT's interface identifier (module + entity, package-id-agnostic). Constraint relaxation is source-compatible.TryCreateAsync<TTemplate>andSubscribeActiveAsync<T>intentionally stayITemplate-constrained — create paths remain template-only. Daml.Runtime.Contracts.CreatedContractgains an init-onlyIReadOnlyList<Identifier> InterfaceIds { get; init; }member carrying the interface ids the participant computed for a created event. Non-breaking: it is not a positional parameter, so existing 3-arg construction keeps working and the field defaults to an empty (non-null) list. Enables interface-only consumption, where a contract is known only as an interface and must be matched/dispatched at runtime.- A
--version-suffixcodegen option that appends a SemVer prerelease suffix (e.g.preview.4) to generated package versions, producing versions like0.1.6.1-preview.4. Mirrors the emitter's own prerelease tag and affects only the generated package<Version>; theDaml.Runtimereference version is unaffected. - A generated
README.mdfor each package, plusPackageTags(andPackageProjectUrl/RepositoryUrl/RepositoryTypewhen--repository-urlis supplied) in the package<PropertyGroup>, so published packages render on nuget.org without the missing-README warning. The README install hint adds--prereleasefor prerelease packages. - Generated Splice/Daml.Finance NuGet packages now ship a package icon (
PackageIcon), so they render with the project icon on nuget.org.
Changed
- The contract-key
Keyaccessor on generated keyed templates now emits a non-partialproperty that throwsNotImplementedException, reverting the body-lesspartialdeclaration introduced in0.1.5. Key-bearing packages now compile and publish standalone: thepartialrequired a hand-rolled implementing partial, which the automated DAR publish pipeline has no author for, so every keyed package failed to build withCS9248(blocking the Daml Finance and Splice publishes). The key type is still generated and serializable for caller-constructed key-based operations, and: IHasKey<TKey>is unchanged — only the body reverts. Generated key-bearing packages consequently no longer pin<LangVersion>13</LangVersion>. Translating the Damlkeyexpression into a real C# projection remains tracked for a future release. - Generated code and runtime messages no longer embed internal issue-tracker references; limitation notes (contract-key projection, generic-type serialization) now read as generic, consumer-facing prose.
Fixed
- Generated C# no longer fails to compile when a record or template references the Daml stdlib enum
DA.Date.Types:DayOfWeek. The enum now resolves to a runtime-providedDaml.Runtime.Stdlib.DayOfWeek(with serialization extensions), matching how otherdaml-stdlibtypes are handled, instead of emitting a conversion call to a helper class that was never generated (CS0103). Because the runtime enum shares its simple name withSystem.DayOfWeek, the reference is emitted fullyglobal::-qualified to avoid an ambiguous reference (CS0104). Unblocks the Daml Financeinterface-types-date-v3package. - Generated C# no longer fails to compile with
CS0542when a Daml record field PascalCases to the same name as its enclosing type (e.g. Daml FinancePeriodwith fieldperiod). The colliding C# member is now disambiguated with a trailing underscore while the Daml record field name used for (de)serialization stays unchanged. - Generated
.csprojfiles now reference co-produced sibling packages using the full package version, including the emitter counter and any--version-suffixprerelease tag. Previously sibling<PackageReference>versions dropped the suffix, so a prerelease set (e.g.3.0.0-preview.4) emitted>= 3.0.0references that NuGet could not resolve (NU1102). - Generated submission-extension XML docs no longer leak an internal issue-tracking reference into consumer output.
- Choice-argument types that reuse the same simple name across different modules no longer collide: the choice-arg-to-template map is now keyed by the module-qualified (
Module:Name) name, so each resolves to its own parent template instead of one silently overwriting the other and emitting unresolvable type references. - A choice-argument type mapped by two templates in the same package no longer overwrites silently: the choice-arg-to-template map now warns and keeps the first-seen mapping (in both
PackageEmitContextandDarCrossPackageResolver) instead of last-wins, so the clash is surfaced rather than mis-resolving cross-references.
What's included
| Package | Purpose |
|---|---|
Daml.Codegen.CSharp |
the C# emitter library |
Daml.Runtime |
runtime types referenced by generated code |
Daml.Ledger.Abstractions |
transport-agnostic ILedgerClient submission/subscription interface |
Daml.Codegen.Testing.Conformance |
compiled conformance corpus + embedded DAR for live-ledger round-trip tests |
The four core packages are versioned in lockstep and published to NuGet.org. The codegen CLI ships separately as a multi-arch OCI component for dpm — oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.4 (linux/amd64, linux/arm64, darwin/arm64, windows/amd64); the per-RID bundle tarballs and all .nupkg/.snupkg files are attached below.
Generated DAR bindings (GitHub Packages)
Generated C# bindings built with this release are published to GitHub Packages (https://nuget.pkg.github.com/peacefulstudio/index.json) and attached here:
- Daml Finance 2.10.0 — 8 packages (
Daml.Finance.*, e.g.Daml.Finance.Util.V4 4.0.0-preview.4) - Splice 0.6.5 — 22 packages (
Splice.*, e.g.Splice.Amulet 0.1.18.1-preview.4)
Versioning and stability
This project is pre-1.0: under SemVer 0.x, any release may change the public API without a major-version bump. This is a preview release.
Getting started
Add the codegen component to your daml.yaml (set DPM_AUTO_INSTALL=true so dpm fetches it on first use):
components:
- oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.4Add the runtime package to your C# project:
dotnet add package Daml.Runtime --prereleaseThen generate from your DAR with dpm codegen-cs — the README Quick Start walks through the full DAR-to-NuGet pipeline, the CLI flags, and the MSBuild integration.
Full changelog
See CHANGELOG.md for the complete record.
0.1.8-preview.2 — CI-verified OS × arch support matrix, Google.Protobuf 3.35.1 floor
Cross-platform hardening on top of 0.1.8-preview.1: every shipped package now has CI-verified support across the full OS × architecture matrix — Linux, Windows, and macOS, on both amd64 and arm64. GeneratedFile.RelativePath is now /-separated on every platform (previously \ on Windows), so codegen output layout is identical across operating systems; Google.Protobuf is raised to 3.35.1 for the Daml.Codegen.CSharp emitter package. No other API changes.
What's included
| Package | Purpose |
|---|---|
Daml.Codegen.CSharp |
the C# emitter library |
Daml.Runtime |
runtime types referenced by generated code |
Daml.Ledger.Abstractions |
transport-agnostic ILedgerClient submission/subscription interface |
Daml.Codegen.Testing.Conformance |
compiled conformance corpus + embedded DAR for live-ledger round-trip tests |
The four packages are versioned in lockstep. The codegen CLI ships separately as a multi-arch OCI component for dpm — oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.2 (linux/amd64, linux/arm64, darwin/arm64, windows/amd64) — and the .nupkg/.snupkg files for this release are attached below, on NuGet.org, and in the publish run's artifacts.
Versioning and stability
This project is pre-1.0: under SemVer 0.x, any release may change the public API without a major-version bump. This is a preview release.
Getting started
Add the codegen component to your daml.yaml (set DPM_AUTO_INSTALL=true so dpm fetches it on first use):
components:
- oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.2Add the runtime package to your C# project:
dotnet add package Daml.Runtime --prereleaseThen generate from your DAR with dpm codegen-cs — the README Quick Start walks through the full DAR-to-NuGet pipeline, the CLI flags, and the MSBuild integration.
Full changelog
See the 0.1.8-preview.2 section of CHANGELOG.md for the complete record.
0.1.8-preview.1 — first public release
First public release of the Daml C# code generator: strongly-typed C# from Daml DARs, targeting the Canton JSON Ledger API.
What's included
| Package | Purpose |
|---|---|
Daml.Codegen.CSharp |
the C# emitter library |
Daml.Runtime |
runtime types referenced by generated code |
Daml.Ledger.Abstractions |
transport-agnostic ILedgerClient submission/subscription interface |
Daml.Codegen.Testing.Conformance |
compiled conformance corpus + embedded DAR for live-ledger round-trip tests |
The four packages are versioned in lockstep. The codegen CLI itself ships separately as a multi-arch OCI component for dpm — oci://ghcr.io/peacefulstudio/dpm-codegen-cs (linux/amd64, linux/arm64, darwin/arm64, windows/amd64) — and the .nupkg files built by this release are available from the publish run's artifacts and on NuGet.org.
Versioning and stability
This project is pre-1.0: under SemVer 0.x, any release may change the public API without a major-version bump. The 0.1.0–0.1.7 sections in the changelog record internal development milestones whose packages were never published to a public feed — 0.1.8-preview.1 is the first release on NuGet.org.
Getting started
Add the codegen component to your daml.yaml (set DPM_AUTO_INSTALL=true so dpm fetches it on first use):
components:
- oci://ghcr.io/peacefulstudio/dpm-codegen-cs:0.1.8-preview.1Add the runtime package to your C# project:
dotnet add package Daml.Runtime --prereleaseThen generate from your DAR with dpm codegen-cs — the README Quick Start walks through the full DAR-to-NuGet pipeline, the CLI flags, and the MSBuild integration.
Full changelog
See the 0.1.8-preview.1 section of CHANGELOG.md for the complete record, including the API-freeze breaking changes relative to the internal milestones.