You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 #2659 (comment) 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:
There was a problem while setting up the environment:
-> Could not find referenced assemblies in path: 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0', please check installed SDK and runtime versions
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
resolved runtime version: 6.0.2
Resolved referenced SDK path: C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0
...
There was a problem while setting up the environment, see standard error for details.
There was a problem while setting up the environment:
-> Could not find referenced assemblies in path: 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.2\ref\net6.0', please check installed SDK and runtime versions
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.
…erKit shored up.
Might be worth moving the starter kit into the main repo.
Note the dogfooding paket group as well as the pinned SDK version in global.json; FAKE scripts wouldn't run at all without pinning the SDK version; see fsprojects/FAKE#2678.
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 #2659 (comment) 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
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?The text was updated successfully, but these errors were encountered: