dotnet/BenchmarkDotNet · error · ArgumentException
Value cannot be null or empty.
Error message
Value cannot be null or empty.
What it means
CustomDotNetCliToolchainBuilder methods like AdditionalNuGetFeed and DisplayName reject null or empty string arguments with an ArgumentException.
Source
Thrown at src/BenchmarkDotNet/Toolchains/DotNetCli/CustomDotNetCliToolchainBuilder.cs:32
protected string? runtimeIdentifier;
protected string? customDotNetCliPath;
protected string? displayName;
protected string? runtimeFrameworkVersion;
protected bool useNuGetClearTag;
protected bool useTempFolderForRestore;
private string? targetFrameworkMoniker;
public abstract IToolchain ToToolchain();
/// <summary>it allows you to define an additional NuGet feed, you can seal the feeds list by using the UseNuGetClearTag() method</summary>
/// <param name="feedName">the name of the feed, will be used in the auto-generated NuGet.config file</param>
/// <param name="feedAddress">the address of the feed, will be used in the auto-generated NuGet.config file</param>
[PublicAPI]
public CustomDotNetCliToolchainBuilder AdditionalNuGetFeed(string feedName, string feedAddress)
{
if (string.IsNullOrEmpty(feedName)) throw new ArgumentException("Value cannot be null or empty.", nameof(feedName));
if (string.IsNullOrEmpty(feedAddress)) throw new ArgumentException("Value cannot be null or empty.", nameof(feedAddress));
Feeds[feedName] = feedAddress;
return this;
}
/// <summary>
/// emits clear tag in the auto-generated NuGet.config file
/// </summary>
public CustomDotNetCliToolchainBuilder UseNuGetClearTag(bool value)
{
useNuGetClearTag = value;
return this;
}
/// <param name="targetFrameworkMoniker">TFM, example: net10.0</param>View on GitHub (pinned to b515068b61)
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.
When it happens
Trigger: Thrown at src/BenchmarkDotNet/Toolchains/DotNetCli/CustomDotNetCliToolchainBuilder.cs:32 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of dotnet/BenchmarkDotNet@b515068b61 (2026-08-13).
Data as JSON: /api/errors/b6bd55f804ea5d1e.
Report an issue: GitHub.