{"record":{"id":"59197142ddf71a28","repo":"BoundaryML/baml","slug":"sdk-csharp-must-identify-nuget-baml-bridge","errorCode":null,"errorMessage":"sdk csharp must identify nuget/baml-bridge","messagePattern":"sdk csharp must identify nuget/baml-bridge","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_release/src/manifest.rs","lineNumber":170,"sourceCode":"fn validate_artifact(name: &str, artifact: &Artifact) -> anyhow::Result<()> {\n    if !artifact.url.starts_with(\"https://\") {\n        anyhow::bail!(\"artifact {name} URL must use HTTPS\");\n    }\n    validate_sha256(&artifact.sha256)?;\n    Ok(())\n}\n\nfn validate_sdk(language: &str, package: &SdkPackage) -> anyhow::Result<()> {\n    if package.registry.is_empty() || package.package.is_empty() || package.version.is_empty() {\n        anyhow::bail!(\"sdk {language} has an empty registry, package, or version\");\n    }\n    if let Some(digest) = &package.verified_package_sha256 {\n        validate_sha256(digest)\n            .map_err(|error| anyhow::anyhow!(\"sdk {language} package digest: {error}\"))?;\n    }\n    if language == \"csharp\" {\n        if package.registry != \"nuget\" || package.package != \"baml-bridge\" {\n            anyhow::bail!(\"sdk csharp must identify nuget/baml-bridge\");\n        }\n        if package.verified_package_sha256.is_none() {\n            anyhow::bail!(\"sdk csharp must record the verified NuGet package digest\");\n        }\n    }\n    if language == \"swift\" {\n        if package.registry != \"swiftpm\" || package.package != \"BoundaryML/baml-swift\" {\n            anyhow::bail!(\"sdk swift must identify swiftpm/BoundaryML/baml-swift\");\n        }\n        if package.verified_package_sha256.is_none() {\n            anyhow::bail!(\"sdk swift must record the verified XCFramework package digest\");\n        }\n    }\n    Ok(())\n}\n\n#[cfg(test)]\nmod tests {","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_release/src/manifest.rs#L152-L188","documentation":"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.","triggerScenarios":"validate_sdk() sees language == \"csharp\" with a registry other than \"nuget\" or a package name other than \"baml-bridge\".","commonSituations":"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.","solutions":["Set registry = \"nuget\" and package = \"baml-bridge\" for the csharp entry","Check for typos or casing differences in either field","Regenerate the manifest from the release tooling instead of editing by hand"],"exampleFix":"// before\n[sdk.csharp]\nregistry = \"nuget\"\npackage = \"Baml\"\n\n// after\n[sdk.csharp]\nregistry = \"nuget\"\npackage = \"baml-bridge\"","handlingStrategy":"validation","validationCode":"fn csharp_entry_valid(p: &SdkPackage) -> bool {\n    p.registry == \"nuget\" && p.package == \"baml-bridge\"\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy pinned SDK entries from the previous release manifest instead of retyping them","Never rename pinned registry/package values manually","Regenerate the manifest from release tooling"],"tags":["manifest","sdk","csharp"],"backgroundTag":"invalid-config-value","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}