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.

RS0016 not recognized using --diagnostics in v6

See original GitHub issue

In the latest v5 I was using the following to execute the code fix of RS0016 through the CLI:

dotnet format SolutionFile.sln --fix-analyzers warn --diagnostics RS0016

Now I’m using the builtin version of .NET 6 and adjusted the syntax to the following:

dotnet format SolutionFile.sln analyzers --diagnostics RS0016

However now I’m receiving the following error:

Unrecognized command or argument ‘RS0016’

The Code-Fix doesn’t seem to execute at all, even if I use dotnet format analyzers without the --diagnostics filter:

dotnet format SolutionFile.sln analyzers

I also tried to play around with the --severity without success. Am I doing something wrong? Is this no longer possible?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
mukunkucommented, Aug 9, 2022

I’m also running into this issue with .net sdk 6.0.300 and the work around isn’t working for me. Things I’ve tried so far:

  1. dotnet format analyzers MySolution.sln --diagnostics="SA1028 SA1107" produces: Unrecognized command or argument 'SA1028 SA1107'
  2. dotnet format analyzers --diagnostics="SA1028 SA1107" produces: Unhandled exception: System.IO.FileNotFoundException: The file 'SA1028 SA1107' does not appear to be a valid project or solution file.
  3. dotnet format analyzers --diagnostics=SA1028 produces Unhandled exception: System.IO.FileNotFoundException: The file 'SA1028' does not appear to be a valid project or solution file.
  4. dotnet format analyzers --diagnostics SA1028 produces Unhandled exception: System.IO.FileNotFoundException: The file 'SA1028' does not appear to be a valid project or solution file.
1reaction
JoeRobichcommented, Nov 8, 2021

This must’ve changed recently since this wasn’t needed before.

It was a breaking change in 6.x. After merging https://github.com/dotnet/format/pull/1291 we only apply code fixes for diagnostics explicitly configured in the .editorconfig, since analyzer packages can specify their own defaults, this ensures that only the analyzer rules that your team has discussed and that you really care about are being enforced.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Analyzer with Code Fix" project template is broken
Short question: How to setup a roslyn code analyzer project with a working unit-test project in Visual Studio 2019 v16.6.2? A few months...
Read more >
MATLAB Simulation of Grid-Connected Photovoltaic System
In this paper work will be briefly covered the principle of operation of photovoltaic system, the procedure of integration of such power plants...
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