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
Today I learned that dotnet format is included with .NET 6.0 SDK, so I ran dotnet format, hoping to find out which arguments it expects:
> dotnet --version
6.0.100-rc.2.21505.57
> dotnet format
Observed results
Red stack trace text filled the console window, scrolling the point it was trying to make with the first line of output off the screen:
> dotnet format
Unhandled exception: System.IO.FileNotFoundException: Could notfind a MSBuild project file or solution file in 'C:\some\path'. Specify which to use with the <workspace> argument.
at Microsoft.CodeAnalysis.Tools.Workspaces.MSBuildWorkspaceFinder.FindWorkspace(String searchDirectory, String workspacePath)
at Microsoft.CodeAnalysis.Tools.Workspaces.MSBuildWorkspaceFinder.FindWorkspace(String searchDirectory, String workspacePath)
at Microsoft.CodeAnalysis.Tools.FormatCommandCommon.ParseWorkspaceOptions(ParseResult parseResult, FormatOptions formatOptions)
at Microsoft.CodeAnalysis.Tools.Commands.RootFormatCommand.FormatCommandDefaultHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass27_0.<<UseVersionOption>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__24_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseDebugDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()
Expected results
The tool should display some concise guidance for the user. Stack traces can be useful when there's an actual catastrophic error, but not so great for missing arguments.
It would be nice to see, for instance, just this (minus the stack trace):
> dotnet format
Could notfind a MSBuild project file or solution file in 'C:\some\path'.
Specify which to use with the <workspace> argument.
Or perhaps to fall back to something like dotnet format --help:
> dotnet format
Usage:
dotnet-format [options] [<The project or solution file to operate on. If a file is not specified, the command will
search the current directory for one.>] [command]
Arguments:
<The project or solution file to operate on. If a file is The project or solution file to operate on. If a file is
not specified, the command will search the current not specified, the command will search the current
directory for one.> directory for one. [default: C:\some\path\]
Options: [... etc ...]
The text was updated successfully, but these errors were encountered:
@nil4 Thanks for reporting. This is a regression from 5.x and earlier versions of 6.x that was introduced when we moved to using subcommands. Will open a PR for the fix.
Today I learned that
dotnet format
is included with .NET 6.0 SDK, so I randotnet format
, hoping to find out which arguments it expects:Observed results
Red stack trace text filled the console window, scrolling the point it was trying to make with the first line of output off the screen:
Expected results
The tool should display some concise guidance for the user. Stack traces can be useful when there's an actual catastrophic error, but not so great for missing arguments.
It would be nice to see, for instance, just this (minus the stack trace):
Or perhaps to fall back to something like
dotnet format --help
:The text was updated successfully, but these errors were encountered: