question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

using --diagnostics appears to be broken (.net 6.0.301)

See original GitHub issue

Running the following dotnet format command reports an error in latest .Net version (6.0.301)

dotnet format --diagnostics 'IDE0001'

Unhandled exception: System.IO.FileNotFoundException: The file β€˜IDE0001’ 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(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()

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
pseidel-kcfcommented, Jun 30, 2022

FWIW I still get errors even with the work around

$ dotnet --version 6.0.301 $ dotnet format --version 6.3.322007+dc5c84e776364e1c23a5cf2d1a848d4022f8634f $ $ dotnet format --diagnostics=IDE0001 Unhandled exception: System.IO.FileNotFoundException: The file β€˜IDE0001’ 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(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()

2reactions
JoeRobichcommented, Jul 9, 2022

This should be resolved in 6.0.4xx SDK branch.

~@WillClayworth you can use --diagnostics=IDE0001 as a workaround with other versions.~ - Edit: This worked for the --include options but not for --diagnostics. =(

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can not publish Blazor wasm to azure anymore
I can publish this one to a folder with no error. So my project is somehow broken...but even older code can't be published....
Read more >
Targeting .NET 6.0 or higher in Visual Studio 2019 is not ...
NETSDK1182 indicates that you're trying to open a .NET 6+ project in Visual Studio 2019. Or you might be trying to build from...
Read more >
The mystery of package downgrade issue
NET Core SDK 2.1 installed. Naturally, very first build failed. The issue. Compilation error said that Detected package downgrade: Microsoft.
Read more >
Why don't any of these methods work for installing .Net ...
I make it run with the APT package solution, in fact there is a conflict ... The solution with the following steps works...
Read more >
Diagnostics - Jon Skeet's coding blog
It looks like this is behaviour that changed with .NET 2.0 – back in 1.x, thread pool exceptions didn't tear down the application....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found