Paket icon indicating copy to clipboard operation
Paket copied to clipboard

Error "Could not parse framework 'net6.0'. Try to update or install again or report a paket bug."

Open knocte opened this issue 2 years ago • 4 comments

Description

Trying to upgrade a project from net5.0 to net6.0 I got the error message from paket "Could not parse framework 'net6.0'. Try to update or install again or report a paket bug.". I just upgraded to last version (stable and preview) to no avail: 6.2.1 and 7.0.0-alpha003.

Repro steps

  1. Clone FSharpLint master.
  2. Upgrade FCS to latest version.
  3. (Because the previous upgrade doesn't work in .net5.0: ) upgrade all projects and CI to .net6.0.
  4. Build fails, so I upgrade paket to 6.2.1.
  5. Build still fails, so I upgrade paket to 7.0.0-alpha003.

Expected behavior

Should build?

Actual behavior

Throws error:

Run dotnet fake build -t Test
Extracted Paket.Restore.targets to: /home/runner/work/FSharpLint/FSharpLint/.paket/Paket.Restore.targets (Can be disabled with PAKET_SKIP_RESTORE_TARGETS=true)
Performance:
 - Cli parsing: 283 milliseconds
 - Packages: 114 milliseconds
 - Script analyzing: 206 milliseconds
 - Runtime: 686 milliseconds
There was a problem while setting up the environment:
-> Error in paket.dependencies line 3
     Could not parse framework 'net6.0'. Try to update or install again or report a paket bug.
Hint: If you just upgraded the fake-runner you can try to remove the .fake directory and try again.

Known workarounds

Nope.

Each of the steps described above is a commit in the following experimental branch (where you can see the CI log): https://github.com/knocte/FSharpLint/commits/fcsAndNet6upgrade

knocte avatar Dec 21 '21 13:12 knocte

This isn't a paket problem, it's a fake problem. Fake bundles paket for use in the script runner, and it's version is out of date. This is part of the larger effort in game to get it updated for dotnet 6, which is still ongoing.

Workarounds include:

  • using nuget refs instead of paket refs in your fake script,
  • using fake from a console application instead of using the fake script runner utility

baronfel avatar Dec 21 '21 13:12 baronfel

Example of using a console app instead of the runner: https://github.com/TheAngryByrd/MiniScaffold/tree/master/Content/Library/build

TheAngryByrd avatar Dec 21 '21 13:12 TheAngryByrd

This isn't a paket problem, it's a fake problem.

Thanks for the info, any github issue in fake repo open to track this problem?

knocte avatar Dec 22 '21 06:12 knocte

Do you think this problem is happening in Expecto repository as well @baronfel ? I'm trying to install it with paket, commands run fine but when I try to use the package errors are thrown

64J0 avatar Jan 14 '22 19:01 64J0