Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet format in SDK 9.0.200 throws FileNotFoundException for .slnx solutions #47038

Open
ownerer opened this issue Feb 22, 2025 · 1 comment

Comments

@ownerer
Copy link

ownerer commented Feb 22, 2025

Describe the bug

dotnet format ConsoleApp1.slnx fails, throwing a FileNotFoundException

To Reproduce

  • Create any new .slnx solution, no need to write any code, just a default console app will do.
  • run dotnet format ConsoleApp1.slnx in a terminal

Exceptions (if any)

Unhandled exception: System.IO.FileNotFoundException: The file 'ConsoleApp1.slnx' does not appear to be a valid project or solution file.
   at Microsoft.CodeAnalysis.Tools.Workspaces.MSBuildWorkspaceFinder.FindFile(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(ParseResult parseResult, CancellationToken cancellationToken)
   at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)

An issue was also raised here, but since this is the main repo apparently I'm opening a new one.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Feb 22, 2025
@ownerer
Copy link
Author

ownerer commented Feb 28, 2025

Tagging format area owners as per the CODEOWNERS file: @sharwell @arunchndr

@arunchndr arunchndr added Feature Request Area-Format and removed untriaged Request triage from a team member labels Mar 7, 2025
@arunchndr arunchndr added this to the 10.0.1xx milestone Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants