Closed InvisibleBacon closed 2 years ago
Welcome to the FAKE community! Thank you so much for creating your first issue and therefore improving the project!
Ah.. well I see I should search through existing issues more carefully before creating a new one. This is a duplicate of https://github.com/fsprojects/FAKE/issues/2641
Description
I am having to specify a sdk version in global.json in order to force Fake to use something greater than netstandard2.0 since our fake script uses async (see https://github.com/fsprojects/FAKE/issues/2659#issuecomment-1048985697 for details).
I was hoping to not require all our devs (and build servers) to require a specific patch of the .NET 6 sdk so I added
"rollForward": "latestPatch"
to the global.json file. However I would get errors like this unless I had the exact SDK version installed:Repro steps
NOTE: I am using the specific version numbers I tested with below, but this appears to be a general problem whenever you don't have the runtime installed that is associated with the SDK patch specified in global.json
On a machine that does not have SDK 6.0.200 and also does not have the 6.0.2 runtime installed, but does have SDK 6.0.202 and runtime 6.0.4, use the specified global.json file:
Run fake (I am including verbose output). You will get this output
Expected behavior
It should have honored the
rollForward
prop and rolled forward to the 6.0.202 SDK and 6.0.4 runtime that I had installed.I later learned that
"rollForward": "latestPatch"
is actually the default behavior if none is specified so ideally I shouldn't have had to do anything to get this behavior.Actual behavior
See repro.
Known workarounds
Only workaround I know of is to require all devs to install a specific SDK version.
Related information
I did look at the source a bit and see that Fake is parsing the global.json file directly to determine the runtime. https://github.com/fsprojects/FAKE/blob/5.22.0/src/app/Fake.DotNet.Cli/DotNet.fs
Is there a way to rely on
dotnet
to give the appropriate sdk/runtime rather than parsing the file directly?