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

Remainder: Set RollForward once we upgraded to .NET core 3.0 #2325

Closed
rusanov-vladimir opened this issue May 29, 2019 · 6 comments · Fixed by #2372
Closed

Remainder: Set RollForward once we upgraded to .NET core 3.0 #2325

rusanov-vladimir opened this issue May 29, 2019 · 6 comments · Fixed by #2372
Labels

Comments

@rusanov-vladimir
Copy link

I'm trying to run fake 5 script on ubuntu using latest .NET core 3 preview5.

I uninstalled previous SDK versions so it's the only .NET core version I got.
After installing global tool with dotnet tool install fake-cli -g
I'm getting error above:

It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.1.0' was not found.

  • The following frameworks were found:
    3.0.0-preview5-27626-15 at [/home/st/dotnet/shared/Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The .NET Core frameworks can be found at:

Seems to be similar to #1974.

Is there any reason why fake cannot run on dotnet core 3.0 preview?

@baronfel
Copy link
Contributor

baronfel commented May 29, 2019

Until fake is published for 3.x, it's not going to run on it successfully. Global tools are runtime-dependent, not self-contained, and so running them requires a compatible runtime to be present on the system. The runtime resolution rules can be found here, but the long and short of it is

  • first check within the same major/minor for a compatible patch version
  • if none found, look for a compatible minor version
  • else fail

It looks like you're hitting the third case, because FAKE is compiled for 2.1, which means it works on 2.1 and 2.2 runtimes.

@matthid
Copy link
Member

matthid commented May 29, 2019

Well they introduced some roll-forward settings we "could" use:

https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0#major-version-roll-forward

-> We could add RollForward=Major to the project file

https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-2-1#roll-forward

-> You can use DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX=2 and DOTNET_ROLL_FORWARD=Major as environment variable

@rusanov-vladimir
Copy link
Author

Thanks for the answers!
I was aware about runtime resolution rules, but it seemed too awkward that net core 3.0 is backward compatible with 2.x but I wasn't able to run fake with it. Using environment variables I'm able to run fake smoothly without installing older runtime. I think adding RollForward=Major to the project would be great to have this behavior out of box without the need of using environment variables.
Thanks again!

@matthid
Copy link
Member

matthid commented May 30, 2019

@rusanov-vladimir Thanks for confirming that this actually works ;)

@matthid matthid added the extern label Jun 8, 2019
@matthid
Copy link
Member

matthid commented Jun 8, 2019

Ok, I'm labeling this as "extern" because dotnet SDK 3 is not yet released. I'm no longer playing around with previews. However, I would probably accept a PR updating all the required places. Considering there is a workaround I'll leave this open as a reminder until SDK v3 has shipped. Please feel free to remind me about this issue when that happened :)

@matthid matthid changed the title Running FAKE on .NET core 3.0 preview5 Remainder: Set RollForward once we upgraded to .NET core 3.0 Jul 2, 2019
@matthid
Copy link
Member

matthid commented Aug 19, 2019

This should be solved in 5.16 due to #2372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants