Skip to content

Build fails with CS9057 error due to analyzer version compiler conflict #2989

Closed
@martincostello

Description

@martincostello

Describe the bug

We have an internal scaffolder template we use to create new .NET applications. This template regularly updates the versions of its dependencies it uses and when a new application is scaffolded it dynamically takes the latest AWS SDK patch versions from NuGet.

This morning as part of a dependabot update and subsequent test of the generator for .NET 6, the build now fails with the following error:

    CSC : error CS9057: The analyzer assembly '/home/runner/.nuget/packages/awssdk.securitytoken/3.7.103.17/analyzers/dotnet/cs/AWSSDK.SecurityToken.CodeAnalysis.dll' references version '4.6.0.0' of the compiler, which is newer than the currently running version '4.3.0.0'. [/tmp/984e20373103b72103fd4a0204e8acfd3d668ba2/src/MyApp/MyApp.csproj]
    CSC : error CS9057: The analyzer assembly '/home/runner/.nuget/packages/awssdk.simplesystemsmanagement/3.7.104.52/analyzers/dotnet/cs/AWSSDK.SimpleSystemsManagement.CodeAnalysis.dll' references version '4.6.0.0' of the compiler, which is newer than the currently running version '4.3.0.0'. [/tmp/984e20373103b72103fd4a0204e8acfd3d668ba2/src/MyApp/MyApp.csproj]

I've not seen this in applications targeting .NET 7 (or at least, not yet).

The last successful CI was 20 hours ago, suggesting the versions published overnight have introduced this issue.

Expected Behavior

The application compiles.

Current Behavior

The application does not compile.

Reproduction Steps

Compile an application targeting .NET 6 with the 6.0.411 SDK which references the AWSSDK.SecurityToken and AWSSDK.SimpleSystemsManagement NuGet packages.

Possible Solution

Downgrade the dependency used to build the .CodeAnalysis packages to be compatible with the C# compiler that ships with the .NET 6 SDK.

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

  • AWSSDK.SecurityToken 3.7.103.17
  • AWSSDK.SimpleSystemsManagement 3.7.104.52

Targeted .NET Platform

.NET SDK 6.0.411 and net6.0

Operating System and version

Linux

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.module/sdk-corep0This issue is the highest priority

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions