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.

Version 4.0.5 seems incompatible with .NET 6

See original GitHub issue

Hi there,

We tried updating to version 4.0.5 of IDisposableAnalyzers, but get an error during dotnet build:

CSC : error CS9057: The analyzer assembly '....\.nuget\packages\idisposableanalyzers\4.0.5\analyzers\dotnet\cs\IDisposableAnalyzers.dll' references version '' of the compiler, which is newer than the currently running version ''. [....csproj]

This is with the most recent version of the .NET 6 SDK: v6.0.407.

With IDisposableAnalyzers 4.0.4, everything is fine. Maybe something changed recently in this project? Unfortunately, I could not find a way to see the diff between 4.0.4 and 4.0.5.

Issue Analytics

  • State:open
  • Created 5 months ago
  • Reactions:2
  • Comments:13

github_iconTop GitHub Comments

canon-benoit-lecardonnelcommented, Apr 10, 2023

FWIW, here is a reproducer project:

When writing this reproducer, I noticed that this issue is only reported as a warning by default. I had to enable TreatWarningsAsErrors to make it fail the build. When TreatWarningsAsErrors is off, the build passes, but it stops reporting any issue with IDisposables (probably because it did not manage to load the analyzer).

I did not manage to make it work from the dotnet CLI (although I did not look for a long time). So it would be great to go back to a previous version indeed, especially since .NET 6 is still under active support by Microsoft until November 2024.

SeMuellcommented, Jun 14, 2023

Issue is related to dotnet/sdk#32598 and dotnet/format#1546 Since the most recent SDK update 7.0.304 I can confirm that it is fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Breaking changes in .NET 6
NET Core or Windows Forms. This article indicates whether each breaking change is binary compatible or source compatible:.
Read more >
.NET Framework 4.5.2, 4.6, 4.6.1 will reach End of Support ...
NET Framework 4.6 on Windows 10 Enterprise LTSC 2015 through end of support of the OS version (October 2025). There is no change...
Read more >
Issues · DotNetAnalyzers/IDisposableAnalyzers
Version 4.0.5 seems incompatible with .NET 6. #479 opened on Apr 10 by canon-benoit- ... IDISP004 triggered if object is wrapped in an...
Read more >
Could not load file or assembly 'Microsoft.CodeAnalysis ...
The dotnet CLI version is '6.0.200'. ... Tomoe is using configuration from '/usr/src/dotnet-sdk-6.0.2/sdk/6.0.200/Sdks/Microsoft.NET.
Read more >
Error NU1202 when upgrading from Net 5.0 to Net 6.0
Reinstall dotnet to make sure the latest SDK is definitely being picked up: Sometimes the wrong SDK is picked up by default.
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 Post

No results found

github_iconTop Related Hashnode Post

No results found