{"record":{"id":"45e6b5572c12d5f6","repo":"dotnet/BenchmarkDotNet","slug":"inconsistent-versions-assemblyversion-and-f","errorCode":null,"errorMessage":"Inconsistent versions: '{assemblyVersion}' and '{fullVersion}'","messagePattern":"Inconsistent versions: '(.+?)' and '(.+?)'","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/BenchmarkDotNet/Properties/BenchmarkDotNetInfo.cs","lineNumber":46,"sourceCode":"        public string FullVersion { get; }\n\n        public bool IsDevelop { get; }\n        public bool IsNightly { get; }\n        public bool IsRelease { get; }\n\n        public string BrandTitle { get; }\n        public string BrandVersion { get; }\n\n        public BenchmarkDotNetInfo(Version assemblyVersion, string fullVersion)\n        {\n            AssemblyVersion = assemblyVersion;\n            FullVersion = fullVersion;\n\n            string versionPrefix = AssemblyVersion.Revision > 0\n                ? AssemblyVersion.ToString()\n                : AssemblyVersion.ToString(3);\n            if (!FullVersion.StartsWith(versionPrefix))\n                throw new ArgumentException($\"Inconsistent versions: '{assemblyVersion}' and '{fullVersion}'\");\n            string versionSuffix = FullVersion.Substring(versionPrefix.Length).TrimStart('-');\n\n            IsDevelop = versionSuffix.StartsWith(\"develop\");\n            IsNightly = AssemblyVersion.Revision > 0;\n            IsRelease = versionSuffix.IsEmpty() && AssemblyVersion.Revision <= 0;\n\n            string brandVersionSuffix = IsDevelop\n                ? \" (\" + DateTime.Now.ToString(\"yyyy-MM-dd\") + \")\"\n                : \"\";\n            BrandVersion = FullVersion + brandVersionSuffix;\n            BrandTitle = \"BenchmarkDotNet v\" + BrandVersion;\n        }\n\n        internal static string RemoveVersionMetadata(string version)\n        {\n            int index = version.IndexOf('+');\n            return index >= 0 ? version.Substring(0, index) : version;\n        }","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/dotnet/BenchmarkDotNet/blob/b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3/src/BenchmarkDotNet/Properties/BenchmarkDotNetInfo.cs#L28-L64","documentation":"Thrown by the BenchmarkDotNetInfo constructor when FullVersion does not start with the expected version prefix derived from AssemblyVersion. The constructor builds a prefix (full 4-part version if Revision > 0, else 3-part) and checks FullVersion.StartsWith(versionPrefix). A mismatch indicates the assembly version and the informational/full version string are out of sync, which can cause incorrect branding or diagnostic output.","triggerScenarios":"Thrown at src/BenchmarkDotNet/Properties/BenchmarkDotNetInfo.cs:46 when the library encounters an invalid state.","commonSituations":"Building BenchmarkDotNet from source with a modified version pipeline, using MinVer or other auto-versioning tools that set informational version independently of assembly version, or after a partial version bump that touched one but not the other.","solutions":["Ensure AssemblyVersion and AssemblyInformationalVersion are consistent: the informational version must start with the assembly version's major.minor.build prefix.","If using Directory.Build.props or versioning tools, verify both version fields are driven from the same source.","In CI, check that the version override step updates both fields."],"exampleFix":"// before (mismatched versions in csproj)\n[assembly: AssemblyVersion(\"0.13.1.0\")]\n[assembly: AssemblyInformationalVersion(\"0.14.0-develop\")]\n\n// after\n[assembly: AssemblyVersion(\"0.13.1.0\")]\n[assembly: AssemblyInformationalVersion(\"0.13.1-develop\")]","handlingStrategy":"validation","validationCode":"// In build scripts, verify version consistency\nvar asmVersion = typeof(BenchmarkDotNetInfo).Assembly.GetName().Version;\nvar infoVersion = FileVersionInfo.GetVersionInfo(typeof(BenchmarkDotNetInfo).Assembly.Location).ProductVersion;\nif (!infoVersion.StartsWith(asmVersion.Revision > 0 ? asmVersion.ToString() : asmVersion.ToString(3)))\n    throw new InvalidOperationException(\"Version mismatch detected.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Drive both AssemblyVersion and AssemblyInformationalVersion from a single version property in Directory.Build.props.","Validate version consistency in CI before publishing packages.","Use a versioning tool (MinVer, Nerdbank.GitVersioning) that keeps both fields synchronized."],"tags":["versioning","build-configuration","startup"],"backgroundTag":null,"analyzedSha":"b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3","analyzedAt":"2026-08-13T19:12:24.196Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}