The analyzer assembly references version '4.6.0.0' of the compiler, which is newer than the currently running version '4.5.0.0'

See original GitHub issue

I’m working on a non-public project. I can provide a repro and/or binlog via Teams.

Having moved to the latest .NET SDK from:

{
  "sdk": {
    "version": "8.0.100-alpha.1.23061.8"
  },
  "tools": {
    "dotnet": "8.0.100-alpha.1.23061.8"
  }
}

…to

{
  "sdk": {
    "version": "8.0.100-preview.2.23115.11"
  },
  "tools": {
    "dotnet": "8.0.100-preview.2.23115.11"
  }
}

I’m no longer able to build:

Build FAILED.

CSC : error CS9057: The analyzer assembly 'D:\Dev\test\.dotnet\sdk\8.0.100-preview.2.23115.11\Sdks\Microsoft.NET.Sdk\codestyle\cs\Microsoft.CodeAnalysis.CodeStyle.dll' references version '4.6.0.0' of the comp 
iler, which is newer than the currently running version '4.5.0.0'. [D:\Dev\test\src\Analyzers\Roslyn4.0\Analyzers.Roslyn4.0.csproj]
CSC : error CS9057: The analyzer assembly 'D:\Dev\test\.dotnet\sdk\8.0.100-preview.2.23115.11\Sdks\Microsoft.NET.Sdk\codestyle\cs\Microsoft.CodeAnalysis.CSharp.CodeStyle.dll' references version '4.6.0.0' of t 
he compiler, which is newer than the currently running version '4.5.0.0'. [D:\Dev\test\src\Analyzers\Roslyn4.0\Analyzers.Roslyn4.0.csproj]
    0 Warning(s)
    2 Error(s)

Welp? 😃

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Reactions:9
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
tmatcommented, Feb 24, 2023

Sometimes the NuGet package ships faster than the .NET SDK.

I’d consider that super niche scenario though that we do not support. It might mean some IDE features are broken.

0reactions
nagilsoncommented, May 16, 2023

I hit this trying to build an older branch of the .NET SDK because the global.json from arcade was pinning to an older assembly version. Anyone else who hits this with a dev sdk should try to update their eng folder to match main if using a newer preview SDK.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix "The analyzer assembly references version '4.7. ...
Razor.SourceGenerators.dll' references version '4.7.0.0' of the compiler, which is newer than the currently running version '4.6.0.0'.".
Read more >
Troubleshoot .NET Framework targeting errors
Reference a project or assembly that targets a different version of .NET. You can create applications that reference projects or assemblies that ...
Read more >
Build Issues when building with .net SDK > 7.0.203 - YouTrack
NET.Sdk.Razor.SourceGenerators.dll' references version '4.6.0.0' of the compiler, which is newer than the currently running version '4.5.
Read more >
Assembly Has a Higher Version Than Referenced .NET Error
This error indicates that there is a version mismatch between what is referenced by the assembly (<Y.Y.Y.Y>) and what the project is pointed ......
Read more >
Dotnet MSBuild fails in docker when source generated file ...
1/analyzers/dotnet/cs/MyGenerator.dll' references version '4.5.0.0' of the compiler, which is newer than the currently running version '4.3.0.0' ...
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