Build Warning CS9057 with .NET SDK 9.0.111
Problem
I get a build warning when I have a dependency on OllamaSharp 5.4.8 with .NET SDK 9.0.111.
The warning message is the following: CSC : warning CS9057: The analyzer assembly '/home/vlabelle/.nuget/packages/ollamasharp/5.4.8/analyzers/dotnet/cs/OllamaSharp.SourceGenerators.dll' references version '4.14.0.0' of the compiler, which is newer than the currently running version '4.12.0.0'.
I'm uncertain, but I believe it might be due to the dependency on Microsoft.CodeAnalysis.CSharp which doesn't specify a version.
Reproduction Steps
- Install .NET SDK 9.0.111
-
dotnet new console -
dotnet add package OllamaSharp -v 5.4.8 -
dotnet build
The issue occurs between 5.4.3 and 5.4.4 where the project updated a bunch of packages. Reverting to 5.4.3 allows code gen to complete as expected. Like the reporter, I suspect this is tied to one of the two updates in this section:
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
I don't really understand how this works but I'm running the latest dotnet 9 sdk for my system and it simply does not ship the version of the compiler this code gen step expects so I cannot run the latest OllamaSharp