I'm on Windows using .NET Core 3.1/5.
I consistently seem to have issues with Ionide reporting errors that do not occur when running dotnet build
/dotnet run
, as well as seemingly locking DLL files preventing me from running dotnet build
until closing VS Code, sometimes even needing to terminate the dotnet process manually.
In the past restarting VS Code when inconsistencies arise has usually resolved issues ("Clear project cache" alone rarely seems to do anything). I've been struggling with one very specific issue with a new project, though:
The exception reported was: System.IO.FileNotFoundException - Could not load file or assembly 'FSharp.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
The exact message varies as I've experimented with a few combinations of package versions and framework targets (netstandard2.0, netcoreapp3.1, net5), but ultimately project definitions/DLLs that work perfectly when building/running seem to fail for a variety of reasons through Ionide.
Another example:
Detected package downgrade: FSharp.Core from 4.7.2 to 4.7.1. Reference the package directly from the project to select a different version.
Even though every .fsproj file includes the following:
<PackageReference Include="FSharp.Core" Version="4.7.2" />
What can I check to find discrepancies between how Ionide runs a build versus how dotnet build
executes?
Found one thing that appears to resolve the immediate issues with the current project: the .props file in the SDK has the following:
Adding:
In my .fsproj files now appears to get everything referencing the same version, rather than the prior inconsistencies between 5.0.0 (when not referenced) and 4.7.1/4.7.2 (when only 4.7.2 was referenced).