{"record":{"id":"df3aa47a660fd13d","repo":"microsoft/aspire","slug":"the-assembly-getname-name-assembly-has-no-informational","errorCode":null,"errorMessage":"The '{assembly.GetName().Name}' assembly has no informational version.","messagePattern":"The '(.+?)' assembly has no informational version\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.CodeGeneration.TypeScript/TypeScriptApiProjector.cs","lineNumber":951,"sourceCode":"                {\n                    child = new ExportedValueTreeNode();\n                    current.Children[segment] = child;\n                }\n\n                current = child;\n            }\n\n            current.Value = exportedValue;\n        }\n\n        return root;\n    }\n\n    private static TypeScriptApiGeneratorIdentity CreateGeneratorIdentity()\n    {\n        var assembly = typeof(TypeScriptApiProjector).Assembly;\n        var version = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion\n            ?? throw new InvalidOperationException(\n                $\"The '{assembly.GetName().Name}' assembly has no informational version.\");\n\n        return new TypeScriptApiGeneratorIdentity(assembly.GetName().Name!, version);\n    }\n\n    /// <summary>\n    /// Projects one builder into an optional documented item plus the declaration fragments it\n    /// contributes.\n    /// </summary>\n    /// <remarks>\n    /// A package can extend a type another package owns. When that happens the type itself is not\n    /// documented here — the owning package publishes it — but the members this package contributes\n    /// still are. They are emitted as a separate interface augmentation fragment so TypeScript\n    /// declaration merging reassembles the referenced stub and this package's contributed surface.\n    /// </remarks>\n    private (TypeScriptApiItem? Item, List<TypeScriptApiDeclaration> Declarations) ProjectBuilder(\n        TypeScriptApiPackageIdentity package,\n        BuilderModel builderModel,","sourceCodeStart":933,"sourceCodeEnd":969,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.CodeGeneration.TypeScript/TypeScriptApiProjector.cs#L933-L969","documentation":"CreateGeneratorIdentity builds the generator identity from the assembly's AssemblyInformationalVersionAttribute. If the attribute is absent (assembly built without version metadata), it throws this InvalidOperationException, since a version is mandatory for the generator identity.","triggerScenarios":"TypeScriptApiProjector initializing (resolving the generator identity) against an assembly compiled without an InformationalVersion, e.g. a stripped or locally hacked build lacking VersionInformational properties.","commonSituations":"Custom/local build script omitting generateAssemblyInfo or informational version; assembly metadata stripped by a post-build tooling step; referencing a malformed build of Aspire.Hosting.CodeGeneration.TypeScript.","solutions":["Build the project with the standard repo build (restore.sh + build.sh) so AssemblyInformationalVersionAttribute is generated.","Ensure the csproj keeps <GenerateAssemblyInfo>true</GenerateAssemblyInfo> and defines a Version/InformationalVersion.","Restore the official NuGet package instead of a locally stripped assembly.","Check for MSBuild targets removing assembly attributes and remove/disable them."],"exampleFix":"// before (csproj)\n<GenerateAssemblyInfo>false</GenerateAssemblyInfo>\n\n// after (csproj)\n<GenerateAssemblyInfo>true</GenerateAssemblyInfo>\n<Version>9.5.0</Version>","handlingStrategy":"validation","validationCode":"var infoVersion = typeof(TypeScriptApiProjector).Assembly\n    .GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;\nif (infoVersion is null) {\n    throw new InvalidOperationException(\"Build the assembly with GenerateAssemblyInfo enabled\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    var identity = CreateGeneratorIdentity();\n} catch (InvalidOperationException ex) when (ex.Message.Contains(\"informational version\")) {\n    // fall back to a known version string or fail the build with a clear message\n    throw;\n}","preventionTips":["Use the standard repo build scripts that generate assembly info.","Never strip assembly attributes in post-build steps for this project.","Keep Version/InformationalVersion set in the csproj.","Prefer official packages over hand-built stripped assemblies."],"tags":["assembly","version","build","csharp"],"backgroundTag":"missing-assembly-version","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}