-
Notifications
You must be signed in to change notification settings - Fork 526
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
Implicit FSharp.Core reference is not considered #3972
Comments
Just leaving this here in case somebody finds this issue and is facing the same cause that I did: I had (because the
Changing this to
made things work. |
I'm just running into this very same issue and after being puzzled for a little while (I removed the FSharp.Core explicit references, but I kept having compile errors) I noticed this line in the
This is probably because I created this project using the instructions of https://github.com/fsprojects/FSharp.TypeProviders.SDK/ (i.e. the "official" SDK for type providers), but those templates do not work well with VS 2022 (it just errors on loading the project). It also fixes the FSharp.Core version to 4.7-ish. Removing it, only just lead to Paket putting it back. Not sure what's going on here or how to fix it... Sorry for blurring the thread with the comment, it's just in case someone has a solution or comes across the cause of this bug. |
Description
If I create new FSharp project,
FSharp.Core
library is referenced implicitly unlessDisableImplicitFSharpCoreReference
is set totrue
, but it isn't by default. Look forFSCorePackageVersion
at\dotnet\sdk\5.0.101\FSharp\Microsoft.FSharp.NetSdk.props
for details.I will lose this reference by using paket for package restore after installing any package to the project.
Repro steps
Dotnet version: 5.0.101
Paket version: 5.257.0
Execute
dotnet new console -lang F# -n Repro
Execute
dotnet build
Reference to
FSharp.Core
is there yet. Check out contents ofproject.assets
file in theobj
folder, you'll see"FSharp.Core/5.0.0"
under the"libraries"
node. Library is copied tobin
folder and is present as reference in the outputRepro.dll
.Execute
paket init
(Suppose that we have it globally)Add any package to the
.fsproj
file. Let it beNewtonSoft.Json
paket add NewtonSoft.Json
paket references
file containing the only line, which isNewtonSoft.Json
Execute
paket install
You'll see
F# project Repro\Repro.fsproj does not reference FSharp.Core.
Execute
dotnet build
FSharp.Core
reference is gone: it's not present inproject.assets
anymore, it's not present in the newly generatedRepro.fsproj.paket.props
, it's not copied to thebin
folder, but is still referenced by the generateddll
, though could not be found.Execute
dotnet run
You'll see
Instead of expected
Expected behavior
FSharp.Core
package is referenced and copied to thebin
folder.Actual behavior
FSharp.Core
is missing, causing runtime error.Known workarounds
Add
FSharp.Core
manually by runningpaket add FSharp.Core
and putting it to the project'spaket.references
file.The text was updated successfully, but these errors were encountered: