OllamaSharp icon indicating copy to clipboard operation
OllamaSharp copied to clipboard

Build Warning CS9057 with .NET SDK 9.0.111

Open vincentlabelle opened this issue 2 months ago • 1 comments

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

  1. Install .NET SDK 9.0.111
  2. dotnet new console
  3. dotnet add package OllamaSharp -v 5.4.8
  4. dotnet build

vincentlabelle avatar Nov 03 '25 18:11 vincentlabelle

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

RobynLlama avatar Nov 23 '25 04:11 RobynLlama