You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Help output for dotnet build appears misleading #52770
According to the Posix Utility Standard#9, the ellipses would indicate that multiple Projects, etc. could be used. It is not legal to use multiple projects, and I assume not legal to use multiple solutions, and the text indicates you can only use one C# file (file based apps).
If there is a reason an array of strings is accepted, and this declaration is created via System.CommandLine, it may be difficult to remove the ellipses. Thus, I suggest the text be reconsidered, such as frequent use of the phrase "a single", as the current phrasing is not clear that only one is allowed:
The project or solution or C# (file-based program) file to operate on. If a file is not specified, the command will search the current directory for a project or solution.
If there is a reason an array of strings is accepted
Yes, the project/solution/file argument name is actually a misnomer - in reality it's a list of any unrecognized arguments and it's just passed down to msbuild.
MSBUILD : error MSB1008: Only one project can be specified.
Perhaps you or @Baronfels or @gewarren could improve the help text for the argument to make it clear that only one is allowed, unless replacing the syntax declaration is reasonable.
Commands that drive the build are especially frustrating from a help/UX perspective because we can't/don't want to model the entire MSBuild command line, and the MSBuild command line implicitly tries to discover a build-able thing in the CWD. We've kinda kept the dotnet CLI out of the business of replicating that probing in the name of having a single source of truth for what that logic actually is.
We could get a bit more crisp here if we took the time to actually model the (optional) buildable thing argument and use it across the codebase. It's just annoying because the file-based app buildable thing has different semantics from the msbuild buildable thing - for file-based apps it must be the first non-binlog argument, but MSbuild will happily accept a sln/slnx/slnf/*proj at any position in the arguments array.
Maybe the correct modeling would be something like
optional argument for a 'file based app' that looks for *.cs input with arity exactlyOne. has a custom parser that rejects all other tokens and is positionally 'first' on the build command(s)
this can have a more explicit arg name/help description that talks about file-based apps
optional argument for 'msbuild buildable thing' that has arity exactlyOne, with a custom arg parser that accepts any sln/slnx/slnf/*proj
this argument will do a default value parser that will do CWD probing/validation similar to what MSbuild does - prefer sln/slnx/slnf over projects in the same working directory, and error if there are more than 1 entry in either category (solution vs project)
this can have a more explicit arg name/help description that talks about projects and solutions
final catch-all argument for the remaining msbuild arguments
this can have a more explicit arg name/help that mentions msbuild arguments and links to the learn docs for the MSBuild CLI interface
Activity
jjonescz commentedon Feb 3, 2026
Yes, the project/solution/file argument name is actually a misnomer - in reality it's a list of any unrecognized arguments and it's just passed down to msbuild.
KathleenDollard commentedon Feb 4, 2026
Interesting. I see that now:
Perhaps you or @Baronfels or @gewarren could improve the help text for the argument to make it clear that only one is allowed, unless replacing the syntax declaration is reasonable.
baronfel commentedon Feb 4, 2026
Commands that drive the build are especially frustrating from a help/UX perspective because we can't/don't want to model the entire MSBuild command line, and the MSBuild command line implicitly tries to discover a build-able thing in the CWD. We've kinda kept the dotnet CLI out of the business of replicating that probing in the name of having a single source of truth for what that logic actually is.
We could get a bit more crisp here if we took the time to actually model the (optional) buildable thing argument and use it across the codebase. It's just annoying because the file-based app buildable thing has different semantics from the msbuild buildable thing - for file-based apps it must be the first non-binlog argument, but MSbuild will happily accept a sln/slnx/slnf/*proj at any position in the arguments array.
Maybe the correct modeling would be something like
*.csinput with arity exactlyOne. has a custom parser that rejects all other tokens and is positionally 'first' on the build command(s)