Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.IO.FileNotFoundException: Could not load file or assembly 'FSharp.Core, Version=6.0.0.0, #4178

Open
inwenis opened this issue Oct 20, 2022 · 2 comments

Comments

@inwenis
Copy link

inwenis commented Oct 20, 2022

Description

I'm trying to install FSharp.Data - causes my app to fail with

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'FSharp.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'FSharp.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at <StartupCode$test3>.$Program.main@()

Repro steps

10-20 15:00:02 C:\git\new_pc> dotnet --version
6.0.401
10-20 15:00:11 C:\git\test3> dotnet new console -lang f#
...
10-20 15:00:24 C:\git\test3> dotnet run
Hello from F#
10-20 15:00:43 C:\git\test3> dotnet new tool-manifest
10-20 15:00:48 C:\git\test3> dotnet tool install paket
You can invoke the tool from this directory using the following commands: 'dotnet tool run paket' or 'dotnet paket'.
Tool 'paket' (version '7.1.5') was successfully installed. Entry is added to the manifest file C:\git\test3\.config\dotnet-tools.json.
10-20 15:00:52 C:\git\test3> dotnet paket add FSharp.Data -p .\test3.fsproj
Paket version 7.1.5+e2fe7c693356a5e70a74cc01501f7dc5f8996695
Adding package 'FSharp.Data'
Resolving dependency graph...
Updated packages:
  Group: Main
    - FSharp.Core: 6.0.6 (added)
    - FSharp.Data: 5.0.2 (added)
Created dependency graph (2 packages in total)
 - Project test3.fsproj needs to be restored
Resolved package 'FSharp.Data' to version 5.0.2
Calling dotnet restore on test3.fsproj
  Determining projects to restore...
  Paket version 7.1.5+e2fe7c693356a5e70a74cc01501f7dc5f8996695
  The last full restore is still up to date. Nothing left to do.
  Total time taken: 0 milliseconds
  Paket version 7.1.5+e2fe7c693356a5e70a74cc01501f7dc5f8996695
  Restoring C:\git\test3\test3.fsproj
  Starting restore process.
  Total time taken: 0 milliseconds
  Restored C:\git\test3\test3.fsproj (in 77 ms).
Total time taken: 1 second
10-20 15:01:27 C:\git\test3> dotnet run
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'FSharp.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'FSharp.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at <StartupCode$test3>.$Program.main@()

Expected behavior

It should just work and print "Hello from F#"

Actual behavior

Fails with

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'FSharp.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'FSharp.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at <StartupCode$test3>.$Program.main@()

Known workarounds

....

@thinkbeforecoding
Copy link
Contributor

This is something that happen when the paket.dependency contains framework restrictions that are not compatible with the nuget framework.
Some packages are netstandard2.0 or netstandard2.1 only, and they are not integrated in the references if the restriction is net6.0 or net7.0
Could this be your problem?

@ChrSteinert
Copy link
Contributor

Should be able to close after #4228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants