SDK 8.0.205
has Microsoft.CodeAnalysis.CSharp.CodeStyle.dll
version 4.9
and SDK 8.0.300
has 4.10
.
<dotnet-home>/<sdk-version>/Sdks/Microsoft.NET.Sdk/codestyle/cs/Microsoft.CodeAnalysis.CSharp.CodeStyle.dll
/usr/share/dotnet/sdk/8.0.300/
~/.dotnet/sdk/8.0.300/
Microsoft.CodeAnalysis.CSharp.CodeStyle.dll
needs Microsoft.CodeAnalysis.dll
when loading
(e.g. for SyntaxList<TNode>
).
There is an incompatibility between Microsoft.CodeAnalysis.CSharp.CodeStyle.dll
4.10
and Microsoft.CodeAnalysis.dll
4.9
.
- Use
dotnet test -p:CodeAnalysisVersion=<version>
to run the test case. - The NuGet reference
Microsoft.CodeAnalysis.CSharp
provides
Microsoft.CodeAnalysis.dll
through the Microsoft.CodeAnalysis.Common dependency. - With package reference
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2"/>
the test only passes on SDK8.0.205
. - See
test workflow
andGitHub Actions
. Notice the failing jobs on SDK8.0.300
in combination with code analysis4.9
.