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

Invalid parameter 'net5.0-windows10.0.17763.0' #2565

Closed
halcwb opened this issue Feb 13, 2021 · 5 comments
Closed

Invalid parameter 'net5.0-windows10.0.17763.0' #2565

halcwb opened this issue Feb 13, 2021 · 5 comments

Comments

@halcwb
Copy link

halcwb commented Feb 13, 2021

Description

When trying to build my solution with just dotnet build. It works. But using fake I get an error

Repro steps

  1. Clone MiniScaffold
  2. Add nuget Informedica.Utils.Lib and Microsoft.Data.SqlClient to dependencies
  3. Run paket install to install the dependencies
  4. Run dotnet fake build -t dotnetbuild

See my below comments that demonstrate the problem in isolation.

Exptected behavior

The solution builds, just like running dotnet build.

Actual behavior

There was a problem while setting up the environment:
-> Error during parsing of 'D:\Development\Informedica\libs\Informedica.ThrowAwayDb.Lib\paket.lock'.
-> failed to parse line ' Microsoft.CSharp (>= 4.5) - restriction: || (&& (< monoandroid9.0) (< net45) (< net5.0-windows10.0.17763.0) (>= netstandard1.3) (< xamarinmac)) (>= uap10.0) (>= xamarinios)' (invalid parameter 'net5.0-windows10.0.17763.0' after >= or < in '< net5.0-windows10.0.17763.0) (>= netstandard1.3) (< xamarinmac)) (>= uap10.0) (>= xamarinios)') (Could not parse 'framework: restriction: || (&& (< monoandroid9.0) (< net45) (< net5.0-windows10.0.17763.0) (>= netstandard1.3) (< xamarinmac)) (>= uap10.0) (>= xamarinios)' as key/value pairs.)
- invalid parameter 'net5.0-windows10.0.17763.0' after >= or < in '< net5.0-windows10.0.17763.0) (>= netstandard1.3) (< xamarinmac)) (>= uap10.0) (>= xamarinios)'
- Could not parse 'framework: restriction: || (&& (< monoandroid9.0) (< net45) (< net5.0-windows10.0.17763.0) (>= netstandard1.3) (< xamarinmac)) (>= uap10.0) (>= xamarinios)' as key/value pairs.
-> invalid delimiter at position 22

Known workarounds

Not using fake

Related information

fake version: 5.20.4-alpha.1642

.NET SDK (reflecting any global.json):
Version: 5.0.103
Commit: 72dec52dbd

Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.103\

Host (useful for support):
Version: 5.0.3
Commit: c636bbdc8a

.NET SDKs installed:
2.1.701 [C:\Program Files\dotnet\sdk]
2.1.801 [C:\Program Files\dotnet\sdk]
2.2.301 [C:\Program Files\dotnet\sdk]
2.2.401 [C:\Program Files\dotnet\sdk]
3.1.100 [C:\Program Files\dotnet\sdk]
3.1.101 [C:\Program Files\dotnet\sdk]
3.1.301 [C:\Program Files\dotnet\sdk]
5.0.103 [C:\Program Files\dotnet\sdk]

@halcwb
Copy link
Author

halcwb commented Feb 13, 2021

The same problem occurs when using an older paket version:

λ dotnet paket install
Paket version 5.251.0
Performance:

  • Runtime: 357 milliseconds
    Paket failed with
    -> Error during parsing of 'D:\Development\Informedica\libs\Informedica.ThrowAwayDb.Lib\paket.lock'.
    -> failed to parse line ' Microsoft.CSharp (>= 4.5) - restriction: || (&& (< monoandroid9.0) (< net45) (< net5.0-windows10.0.17763.0) (>= netstandard1.3) (< xamarinmac)) (>= uap10.0) (>= xamarinios)' (invalid parameter 'net5.0-windows10.0.17763.0' after >= or < in '< net5.0-windows10.0.17763.0) (>= netstandard1.3) (< xamarinmac)) (>= uap10.0) (>= xamarinios)') (Could not parse 'framework: restriction: || (&& (< monoandroid9.0) (< net45) (< net5.0-windows10.0.17763.0) (>= netstandard1.3) (< xamarinmac)) (>= uap10.0) (>= xamarinios)' as key/value pairs.)
    - invalid parameter 'net5.0-windows10.0.17763.0' after >= or < in '< net5.0-windows10.0.17763.0) (>= netstandard1.3) (< xamarinmac)) (>= uap10.0) (>= xamarinios)'
    - Could not parse 'framework: restriction: || (&& (< monoandroid9.0) (< net45) (< net5.0-windows10.0.17763.0) (>= netstandard1.3) (< xamarinmac)) (>= uap10.0) (>= xamarinios)' as key/value pairs.
    -> invalid delimiter at position 22
    cbollen@PC047133 /d/Development/Informedica/libs/Informedica.ThrowAwayDb.Lib (master)
    λ dotnet tool restore
    Tool 'sourcelink' (version '3.1.1') was restored. Available commands: sourcelink
    Tool 'dotnet-reportgenerator-globaltool' (version '4.2.15') was restored. Available commands: reportgenerator
    Tool 'fake-cli' (version '5.20.4-alpha.1642') was restored. Available commands: fake
    Tool 'paket' (version '6.0.0-beta8') was restored. Available commands: paket
    Tool 'fcswatch-cli' (version '0.7.14') was restored. Available commands: fcswatch
    Tool 'fsharp-analyzers' (version '0.7.0') was restored. Available commands: fsharp-analyzers

Restore was successful.
cbollen@PC047133 /d/Development/Informedica/libs/Informedica.ThrowAwayDb.Lib (master)
λ dotnet paket install
Paket version 6.0.0-beta8
Skipping resolver for group Analyzers since it is already up-to-date
Skipping resolver for group Build since it is already up-to-date
Skipping resolver for group Docs since it is already up-to-date
Skipping resolver for group Main since it is already up-to-date
Installing into projects:
Created dependency graph (563 packages in total)
Total time taken: 23 milliseconds
cbollen@PC047133 /d/Development/Informedica/libs/Informedica.ThrowAwayDb.Lib (master)

@halcwb
Copy link
Author

halcwb commented Feb 14, 2021

Further isolated the problem to:

// fails
//#r "nuget: Paket.Core, 6.0.0-alpha050"
// fails
//#r "nuget: Paket.Core, 5.251.0"
// works
#r "nuget: Paket.Core, 6.0.0-beta8"

open System.IO
open Paket

let path = Path.GetFullPath(".")
let lockFile = Path.Combine(path, "paket.lock")
File.Exists(lockFile)

LockFile.LoadFrom(lockFile)

Use the attached lock file.

So upgrading to Paket.Core 6.0.0-beta8 should do the trick.
paket.lock.txt

@yazeedobaid
Copy link
Collaborator

I was investigating this issue and FAKE is using a different Paket version than the one you are specifying in your repository - MiniScaffold.
In your repository, you are using the beta version of Paket to restore your dependencies and FAKE uses another version internally as you specified above by trying multiple versions of Paket.Core to load the lock file.
Why not use stable versions of both FAKE and Paket?

@halcwb
Copy link
Author

halcwb commented Mar 18, 2021

I was investigating this issue and FAKE is using a different Paket version than the one you are specifying in your repository - MiniScaffold.
In your repository, you are using the beta version of Paket to restore your dependencies and FAKE uses another version internally as you specified above by trying multiple versions of Paket.Core to load the lock file.
Why not use stable versions of both FAKE and Paket?

Because the stable version of Paket cannot handle net5 references. That's the essence of the problem.

@github-actions
Copy link

There has not been any activity in this issue for the last 3 months so it will be closed in 14 days if there is no activity.

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

Successfully merging a pull request may close this issue.

2 participants