dotnet 3.1 always restores latest fsharp.core version
See original GitHub issueDescription
After upgrading from .net 3.0.100 to 3.1.100 it writes incorrect version of FSharp.Core to project.assets.json
.
I have pinned FSharp.Core to 4.6 however it seems .net 3.1 tries to restore latest FSharp.Core 4.7
Repro steps
https://github.com/theimowski/net40_fsharp_core_3.1.2.5
Don’t pay attention to repository name - initally I thought it was related to net40 and this old version of fsharp core, but found the issue is more generic
- dotnet build
Expected behavior
FSharp.Core version 4.6 in project.assets.json
Actual behavior
FSharp.Core 4.7 in project.assets.json
Known workarounds
I originally discovered this issue for net40 framework and old version of fsharp.core: 3.1.2.5, because for this mix dotnet build
failed with a “Package FSharp.Core 4.7.0 is not compatible with net40” error:
> dotnet build
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Paket version 5.241.5
Starting full restore process.
Performance:
- Disk IO: 123 milliseconds
- Runtime: 965 milliseconds
/Users/theimowski/sandbox/paket/net40_fsharp_core_3.1.2.5/net40_fsharp_core_3.1.2.5.fsproj : error NU1202: Package FSharp.Core 4.7.0 is not compatible with net40 (.NETFramework,Version=v4.0). Package FSharp.Core 4.7.0 supports:
/Users/theimowski/sandbox/paket/net40_fsharp_core_3.1.2.5/net40_fsharp_core_3.1.2.5.fsproj : error NU1202: - net45 (.NETFramework,Version=v4.5)
/Users/theimowski/sandbox/paket/net40_fsharp_core_3.1.2.5/net40_fsharp_core_3.1.2.5.fsproj : error NU1202: - netstandard2.0 (.NETStandard,Version=v2.0)
Restore failed in 242.67 ms for /Users/theimowski/sandbox/paket/net40_fsharp_core_3.1.2.5/net40_fsharp_core_3.1.2.5.fsproj.
When I did dotnet paket restore
before dotnet build
the restore completed succesfully, but only for this net40 + fsharp.core 3.1.2.5 mix
The version written to project.assets.json was also correct:
> dotnet paket restore
Paket version 5.241.5
Starting full restore process.
Performance:
- Disk IO: 121 milliseconds
- Runtime: 871 milliseconds
> dotnet build
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 217.41 ms for /Users/theimowski/sandbox/paket/net40_fsharp_core_3.1.2.5/net40_fsharp_core_3.1.2.5.fsproj.
Not sure what’s happening here - tried to compare the files created by paket in obj directory but they seem to be identical in both cases…
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (10 by maintainers)
Top GitHub Comments
The other way is to put the tags into the fsproj as described above.
/cc @matthid
It doesn’t matter. In any case a new fake release is required and that always takes a while, so feel free to fix when appropriate and then it will flow into fake as usual 😉
I don’t feel like this is critical enough to justify rushing a release train. Several workarounds are available.