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

roslynator.dotnet.cli throws System.ArgumentException on xunit 2.8.1 projects #1473

Closed
ArwynFr opened this issue May 27, 2024 · 0 comments · Fixed by #1477
Closed

roslynator.dotnet.cli throws System.ArgumentException on xunit 2.8.1 projects #1473

ArwynFr opened this issue May 27, 2024 · 0 comments · Fixed by #1477
Assignees

Comments

@ArwynFr
Copy link

ArwynFr commented May 27, 2024

Product and Version Used:
'roslynator.dotnet.cli' (version '0.8.8')

Steps to Reproduce:
Full example: ArwynFr/dotnet-integration-testing#42

Actual Behavior:

[ERR] VerifyRoslyn: System.AggregateException: One or more errors occurred. (Argument contains duplicate analyzer instances. (Parameter 'analyzers'))
  [ERR] VerifyRoslyn:  ---> System.ArgumentException: Argument contains duplicate analyzer instances. (Parameter 'analyzers')
  [ERR] VerifyRoslyn:    at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.VerifyAnalyzersArgumentForStaticApis(ImmutableArray`1 analyzers, Boolean allowDefaultOrEmpty)
  [ERR] VerifyRoslyn:    at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.VerifyArguments(Compilation compilation, ImmutableArray`1 analyzers, CompilationWithAnalyzersOptions analysisOptions)
  [ERR] VerifyRoslyn:    at Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers..ctor(Compilation compilation, ImmutableArray`1 analyzers, CompilationWithAnalyzersOptions analysisOptions)
  [ERR] VerifyRoslyn:    at Roslynator.Diagnostics.CodeAnalyzer.AnalyzeProjectCoreAsync(Project project, ImmutableArray`1 analyzers, CancellationToken cancellationToken) in /_/src/Workspaces.Core/Diagnostics/CodeAnalyzer.cs:line 165
  [ERR] VerifyRoslyn:    at Roslynator.Diagnostics.CodeAnalyzer.AnalyzeProjectCoreAsync(Project project, CancellationToken cancellationToken) in /_/src/Workspaces.Core/Diagnostics/CodeAnalyzer.cs:line 132
  [ERR] VerifyRoslyn:    at Roslynator.Diagnostics.CodeAnalyzer.AnalyzeSolutionAsync(Solution solution, Func`2 predicate, CancellationToken cancellationToken) in /_/src/Workspaces.Core/Diagnostics/CodeAnalyzer.cs:line 71
  [ERR] VerifyRoslyn:    at Roslynator.CommandLine.AnalyzeCommand.ExecuteAsync(ProjectOrSolution projectOrSolution, CancellationToken cancellationToken) in /_/src/CommandLine/Commands/AnalyzeCommand.cs:line 80
  [ERR] VerifyRoslyn:    at Roslynator.CommandLine.MSBuildWorkspaceCommand`1.ExecuteAsync(String path, MSBuildWorkspace workspace, CancellationToken cancellationToken) in /_/src/CommandLine/Commands/MSBuildWorkspaceCommand.cs:line 164
  [ERR] VerifyRoslyn:    at Roslynator.CommandLine.MSBuildWorkspaceCommand`1.ExecuteAsync(IEnumerable`1 paths, String msbuildPath, IEnumerable`1 properties) in /_/src/CommandLine/Commands/MSBuildWorkspaceCommand.cs:line 89
  [ERR] VerifyRoslyn:    at Roslynator.CommandLine.Program.AnalyzeAsync(AnalyzeCommandLineOptions options) in /_/src/CommandLine/Program.cs:line 343
  [ERR] VerifyRoslyn:    --- End of inner exception stack trace ---
  [ERR] VerifyRoslyn:    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
  [ERR] VerifyRoslyn:    at Roslynator.CommandLine.Program.<>c.<Main>b__0_3(MSBuildCommandLineOptions options) in /_/src/CommandLine/Program.cs:line 175
  [ERR] VerifyRoslyn:    at CommandLine.ParserResultExtensions.MapResult[T1,T2,TResult](ParserResult`1 result, Func`2 parsedFunc1, Func`2 parsedFunc2, Func`2 notParsedFunc)
  [ERR] VerifyRoslyn:    at Roslynator.CommandLine.Program.Main(String[] args) in /_/src/CommandLine/Program.cs:line 169

Expected Behavior:

Analyzed solution '/home/runner/work/dotnet-integration-testing/dotnet-integration-testing/dotnet-integration-testing.sln' (in 6,1 s)
@ArwynFr ArwynFr changed the title roslynator.dotnet.cli throws System.ArgumentException roslynator.dotnet.cli throws System.ArgumentException on xunit 2.8.1 projects May 27, 2024
@josefpihrt josefpihrt self-assigned this May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants