Version 4.0.5 seems incompatible with .NET 6
See original GitHub issueHi 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 '4.5.0.0' of the compiler, which is newer than the currently running version '4.3.0.0'. [....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:
- Created 5 months ago
- Reactions:2
- Comments:13
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FWIW, here is a reproducer project: https://github.com/canon-benoit-lecardonnel/ReproIDisposableAnalyzers479
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. WhenTreatWarningsAsErrors
is off, the build passes, but it stops reporting any issue withIDisposable
s (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.
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.