{"record":{"id":"b6bd55f804ea5d1e","repo":"dotnet/BenchmarkDotNet","slug":"value-cannot-be-null-or-empty","errorCode":null,"errorMessage":"Value cannot be null or empty.","messagePattern":"Value cannot be null or empty\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/BenchmarkDotNet/Toolchains/DotNetCli/CustomDotNetCliToolchainBuilder.cs","lineNumber":32,"sourceCode":"\n        protected string? runtimeIdentifier;\n        protected string? customDotNetCliPath;\n        protected string? displayName;\n        protected string? runtimeFrameworkVersion;\n\n        protected bool useNuGetClearTag;\n        protected bool useTempFolderForRestore;\n        private string? targetFrameworkMoniker;\n\n        public abstract IToolchain ToToolchain();\n\n        /// <summary>it allows you to define an additional NuGet feed, you can seal the feeds list by using the UseNuGetClearTag() method</summary>\n        /// <param name=\"feedName\">the name of the feed, will be used in the auto-generated NuGet.config file</param>\n        /// <param name=\"feedAddress\">the address of the feed, will be used in the auto-generated NuGet.config file</param>\n        [PublicAPI]\n        public CustomDotNetCliToolchainBuilder AdditionalNuGetFeed(string feedName, string feedAddress)\n        {\n            if (string.IsNullOrEmpty(feedName)) throw new ArgumentException(\"Value cannot be null or empty.\", nameof(feedName));\n            if (string.IsNullOrEmpty(feedAddress)) throw new ArgumentException(\"Value cannot be null or empty.\", nameof(feedAddress));\n\n            Feeds[feedName] = feedAddress;\n\n            return this;\n        }\n\n        /// <summary>\n        /// emits clear tag in the auto-generated NuGet.config file\n        /// </summary>\n        public CustomDotNetCliToolchainBuilder UseNuGetClearTag(bool value)\n        {\n            useNuGetClearTag = value;\n\n            return this;\n        }\n\n        /// <param name=\"targetFrameworkMoniker\">TFM, example: net10.0</param>","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/dotnet/BenchmarkDotNet/blob/b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3/src/BenchmarkDotNet/Toolchains/DotNetCli/CustomDotNetCliToolchainBuilder.cs#L14-L50","documentation":"CustomDotNetCliToolchainBuilder methods like AdditionalNuGetFeed and DisplayName reject null or empty string arguments with an ArgumentException.","triggerScenarios":"Thrown at src/BenchmarkDotNet/Toolchains/DotNetCli/CustomDotNetCliToolchainBuilder.cs:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-null, non-empty feed name and feed address to AdditionalNuGetFeed (and a non-empty display name to DisplayName).","Guard your configuration code with string.IsNullOrEmpty before calling the builder method."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b515068b61ad1c9c9aa938b8ece4af1e7d6d85a3","analyzedAt":"2026-08-13T19:12:24.196Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}