question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet 3.1 always restores latest fsharp.core version

See original GitHub issue

Description

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

  1. 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:open
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
forkicommented, Jan 4, 2020

The other way is to put the tags into the fsproj as described above.

/cc @matthid

0reactions
matthidcommented, Jan 4, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get exact F# version number (e.g.: 4.7.2, not just 4.7)
When the colleague regenerated the lockfiles (using dotnet restore --locked-mode --force-evaluate ), the only change we found was in the FSharp.
Read more >
Announcing .NET Core 3.1
We're excited to announce the release of .NET Core 3.1. It's really just a small set of fixes and refinements over .NET Core...
Read more >
Select which .NET version to use
NET CLI must choose an SDK version for every dotnet command. It uses the latest SDK installed on the machine by default, even...
Read more >
NuGet Package Version Reference
Always specify a version or version range for package dependencies in project files, packages.config files, and .nuspec files. Without a version ...
Read more >
MSBuild reference for .NET SDK projects
Reference for the MSBuild properties and items that are understood by the .NET SDK.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found