.netf#nugetfable-f#paket

F# - unwanted reference to FSharp.Core 9.0 after paket clear-cache causes build error


I recently ran a somewhat bold paket clear-cache and my F# application started behaving strangely. Some of my projects that were referencing an older version of FSharp.Core now reference the new v9.0.

I never paid attention to it, maybe a similar move was also bumping versions before but it has always transparent for me. Now I wouldn't mind if I didn't get this dreaded error at compile time this time: File '.../.nuget/packages/fsharp.core/9.0.100/lib/netstandard2.0/FSharp.Core.optdata' not found alongside FSharp.Core.

What I tried so far:

Note: all builds attempts were both in my IDE (Rider) and with dotnet build.

My best bet now is that a non-Paket managed library has a dependency to FSharp.Core and DependencyVersion Lowest somehow didn't work, resulting in the newly released version of FSharp.Core being used, but I didn't add references lately and I try to keep all my stuff in Paket, so any help is welcome.


Solution

  • OK, I solved it by cleaning all bin and obj directories in the projects and referencing a strict version of FSharp.Core in paket.dependencies. Still weird that FSharp.Core 9 was referenced in the first place...