Skip to content

Analyzers 0.19.1 cannot be used with the .net 6 SDKs #199

Description

@robertMSFTE

Description

Analyzers 0.19.1 cannot be used with the newest .net 6 SDKs - 6.0.410

Complete minimal example reproducing the issue

Created a project that uses the anlyzers with the following global.json file:

{
  "sdk": {
    "version": "6.0.410"
  },
  "msbuild-sdks": {
    "Microsoft.Build.Traversal": "4.1.0"
  }
}

And tried building as such:

dotnet build .\TestProject1.csproj --restore -c "Release" /p:Platform=x64   /p:RunAnalyzersDuringBuild=true /WarnAsError

Expected behavior:

No warnings or errors.

Actual behavior:

Error:

CSC : warning CS9057: The analyzer assembly 'C:\Users\xxx\.nuget\packages\fluentassertions.analyzers\0.19.1\analyzers\dotnet\cs\FluentAssertions.Analyzers.dll' references version '4.6.0.0' of the compiler, which is newer than the curr ently running version '4.3.0.0'. [C:\Users\xxx\source\repos\TestProject1\TestProject1\TestProject1.csproj]

Versions

  • Which version of Fluent Assertions Analyzers are you using? 0.19.1
  • Which .NET runtime and version are you targeting? .Net 6.0.18

Additional Information

This is caused by this commit #185. Simple fix would be to change version of Microsoft.CodeAnalysis.CSharp.Workspaces to 4.3.1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions