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 'net60' after >= or < in '== net50' while upgrading netcoreapp3.1 to net5.0 #2564

Open
imranypatel opened this issue Jan 16, 2021 · 23 comments

Comments

@imranypatel
Copy link

imranypatel commented Jan 16, 2021

Description

Error while targetting net5.0 framework.

Repro steps

  1. dotnet new -i Saturn.Template
  2. md saturn2net5
  3. dotnet new saturn -lang F#
  4. Change TFM in saturn2net5.fsproj TargetFramework as: net5.0
  5. Change TFM in paket.dependencies as: framework: net5.0
  6. dotnet new tool-manifest --force
  7. dotnet tool install paket
  8. dotnet tool install fake-cli
  9. dotnet tool install saturn.cli
  10. dotnet paket update
  11. dotnet fake build -t run

Expected behavior

Build and run project successfully on net5.0

Actual behavior

Producing error:

There was a problem while setting up the environment:
-> Error during parsing of 'D:\Work\iprnd\fs\ipstackNG21\saturn2net5\paket.lock'.
-> invalid parameter 'net50' after >= or < in '== net50'
Hint: If you just upgraded the fake-runner you can try to remove the .fake directory and try again.

Known workarounds

Still searching...

Related information

  • Operating system Windows 10
  • Version of .Net Core

.NET SDK (reflecting any global.json):
Version: 5.0.101
Commit: d05174dc5a

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19041
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.101\

  • Version of Paket (5.257.0)
  • Version of FAKE-CLI (5.20.3)
  • Version of SATURN.CLI (0.12.1)
  • Version of F#

D:\Work\iprnd\fs\ipstackNG21\saturn2net5>dotnet fsi
Microsoft (R) F# Interactive version 11.0.0.0 for F# 5.0

@github-actions
Copy link
Contributor

Welcome to the FAKE community! Thank you so much for creating your first issue and therefore improving the project!

@halcwb
Copy link

halcwb commented Feb 14, 2021

I think this is the same issue as I have.

@seanamosw
Copy link
Contributor

Using the pre-release 5.20.4-alpha.1642 works for me for now.

@halcwb
Copy link

halcwb commented Feb 16, 2021

Unfortunately not for me. And it's a pity that none of the maintainers are responding to these issues.

@matthid
Copy link
Member

matthid commented Feb 16, 2021

@halcwb Sorry, I kind of lost motivation for various reasons. Nobody volunteered yet to take over. And to be honest some people prefer the "the build as a project && dotnet run" approach which doesn't have issues like these and might be a way out of this as I guess you are not volunteering to take over.

@halcwb
Copy link

halcwb commented Feb 17, 2021

@matthid. I am sorry to hear this. I do sympathise with your predicament. This is something that happens more often in other really wonderful F# open source projects. It's the burden of maintenance. Unfortunately, I am not really qualified to help you, I am a full time pediatric intensive care doctor who can only work on software projects in spare time.

Doesn't Microsoft or other companies invest any resources to help you? It would be a shame if Fake would just wither away like this.

P.S. I did try to upgrade to the latest Paket in a cloned Fake. But got the same error message, maybe because the bootstrapping of FAKE used the old FAKE version?

P.P.S. Isn't this pull request the solution? #2556.

@Thorium
Copy link
Member

Thorium commented Mar 3, 2021

I get this error without targeting .net50
Paket version 5.257.0
My paket.dependencies says frameworks: net461, netcoreapp3.1, netstandard2.0
...but Paket has itself put net50 to paket.lock in some reference components.

@halcwb
Copy link

halcwb commented Mar 4, 2021

@halcwb Sorry, I kind of lost motivation for various reasons. Nobody volunteered yet to take over. And to be honest some people prefer the "the build as a project && dotnet run" approach which doesn't have issues like these and might be a way out of this as I guess you are not volunteering to take over.

@matthid I have 'upgraded' your issue to the F# forum. Hope you agree, but I think this is quite relevant in general.

@Thorium
Copy link
Member

Thorium commented Mar 5, 2021

If I manually replace from paket.lock

  • (< net50)
  • - restriction: >= net50
  • (>= net50)

...with empty string, then I'm able to run the build.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2021

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.

@github-actions github-actions bot added the stale label Jun 4, 2021
@Thorium
Copy link
Member

Thorium commented Jun 4, 2021

How is non-merged PR-fix not any action?

@ScottShingler
Copy link

This issue has not been resolved and should be reopened.

@dsyme
Copy link
Collaborator

dsyme commented Nov 6, 2021

@yazeedobaid Note there are many issues which were automatically closed by the auto-closing agent bot which was set up in this repo (I don't know why...)

@dsyme dsyme reopened this Nov 6, 2021
@yazeedobaid
Copy link
Collaborator

yazeedobaid commented Nov 7, 2021

@yazeedobaid Note there are many issues which were automatically closed by the auto-closing agent bot which was set up in this repo (I don't know why...)

@dsyme Thanks for the note. I have disabled the stable bot in the .NET 6 support PR, in this commit
Thanks

@dsyme dsyme changed the title invalid parameter 'net50' after >= or < in '== net50' while upgrading netcoreapp3.1 to net5.0 invalid parameter 'net60' after >= or < in '== net50' while upgrading netcoreapp3.1 to net5.0 Nov 7, 2021
@CumpsD
Copy link

CumpsD commented Nov 9, 2021

I encountered this as well today, here's a twitter convo with @forki indicating Paket supports it but the Paket in FAKE is probably outdated: https://twitter.com/sforkmann/status/1458104833723060226

@dsyme
Copy link
Collaborator

dsyme commented Nov 9, 2021

We do need an update to FAKE fairly soon that either takes out the Paket support, or makes it optional (is there a way to do this?), or brings it up-to-date. FAKE is currently unusable as soon as Paket is used with anything net60.

@CumpsD
Copy link

CumpsD commented Nov 9, 2021

@dsyme
Copy link
Collaborator

dsyme commented Nov 9, 2021

Yes I think we should be pushing it to nuget ASAP - even if it's marked pre-release. @yazeedobaid is looking at the release pipeline I think

@atlemann
Copy link
Contributor

atlemann commented Dec 2, 2021

We do need an update to FAKE fairly soon that either takes out the Paket support, or makes it optional (is there a way to do this?), or brings it up-to-date. FAKE is currently unusable as soon as Paket is used with anything net60.

I guess it was introduced to be able to reference NuGet packages in the build.fsx files, but now that this has native support, maybe FAKE cli doesn't have to rely on Paket anymore? You won't get the lock file for the script file anymore though, but maybe that's Ok.

@atlemann
Copy link
Contributor

atlemann commented Dec 8, 2021

Replacing

#I __SOURCE_DIRECTORY__

#r "paket: groupref Build //"

#load @".fake/build.fsx/intellisense.fsx"

#if !FAKE
  #r "netstandard"
#endif

with the following

#r "nuget:Fake.Core.Process"
#r "nuget:Fake.Core.Environment"
#r "nuget:Fake.Core.SemVer"
#r "nuget:Fake.Core.Target"
#r "nuget:Fake.DotNet.Cli"
#r "nuget:Fake.DotNet.MSBuild"
#r "nuget:System.Reactive"
#r "nuget:MSBuild.StructuredLogger,2.1.507" // Workaround for issue https://github.com/fsprojects/FAKE/issues/2595

let execContext = Fake.Core.Context.FakeExecutionContext.Create true "" []
Fake.Core.Context.setExecutionContext (Fake.Core.Context.RuntimeContext.Fake execContext)

and running with

dotnet fsi build.fsx

might be a workaround. Just have to figure out how to pass any target arguments into the script.

@voronoipotato
Copy link
Contributor

voronoipotato commented Jun 16, 2022

if fsharp/fslang-suggestions#1144 were implemented using fsi might be a viable solution rather than just a workaround. If you need args for your fsx you can use https://stackoverflow.com/questions/27342987/run-f-script-with-parameters/55719236#55719236

@yazeedobaid yazeedobaid removed the stale label Jul 25, 2022
@Thorium
Copy link
Member

Thorium commented Nov 15, 2023

This will probably hit after every new .NET major version release.
I almost miss the FSharpTargetsPath. :-D

@Thorium
Copy link
Member

Thorium commented Sep 1, 2024

Paket dependency has been updated, helps this. For future issues: Paket dependency has to be kept up-to-date.

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.