BoundaryML/baml · error

sdk csharp must identify nuget/baml-bridge

Error message

sdk csharp must identify nuget/baml-bridge

What it means

The C# SDK entry is pinned: it must declare registry "nuget" and package "baml-bridge". Any other registry/package combination for language "csharp" fails validation to keep release manifests consistent with the published NuGet package.

Source

Thrown at baml_language/crates/baml_release/src/manifest.rs:170

fn validate_artifact(name: &str, artifact: &Artifact) -> anyhow::Result<()> {
    if !artifact.url.starts_with("https://") {
        anyhow::bail!("artifact {name} URL must use HTTPS");
    }
    validate_sha256(&artifact.sha256)?;
    Ok(())
}

fn validate_sdk(language: &str, package: &SdkPackage) -> anyhow::Result<()> {
    if package.registry.is_empty() || package.package.is_empty() || package.version.is_empty() {
        anyhow::bail!("sdk {language} has an empty registry, package, or version");
    }
    if let Some(digest) = &package.verified_package_sha256 {
        validate_sha256(digest)
            .map_err(|error| anyhow::anyhow!("sdk {language} package digest: {error}"))?;
    }
    if language == "csharp" {
        if package.registry != "nuget" || package.package != "baml-bridge" {
            anyhow::bail!("sdk csharp must identify nuget/baml-bridge");
        }
        if package.verified_package_sha256.is_none() {
            anyhow::bail!("sdk csharp must record the verified NuGet package digest");
        }
    }
    if language == "swift" {
        if package.registry != "swiftpm" || package.package != "BoundaryML/baml-swift" {
            anyhow::bail!("sdk swift must identify swiftpm/BoundaryML/baml-swift");
        }
        if package.verified_package_sha256.is_none() {
            anyhow::bail!("sdk swift must record the verified XCFramework package digest");
        }
    }
    Ok(())
}

#[cfg(test)]
mod tests {

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Set registry = "nuget" and package = "baml-bridge" for the csharp entry
  2. Check for typos or casing differences in either field
  3. Regenerate the manifest from the release tooling instead of editing by hand

Example fix

// before
[sdk.csharp]
registry = "nuget"
package = "Baml"

// after
[sdk.csharp]
registry = "nuget"
package = "baml-bridge"
Defensive patterns

Strategy: validation

Validate before calling

fn csharp_entry_valid(p: &SdkPackage) -> bool {
    p.registry == "nuget" && p.package == "baml-bridge"
}

Prevention

When it happens

Trigger: validate_sdk() sees language == "csharp" with a registry other than "nuget" or a package name other than "baml-bridge".

Common situations: Renaming the package in the manifest by hand; using the old package name; copy-pasting an entry template from another language and not updating both fields.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/59197142ddf71a28. Report an issue: GitHub.