FAKE
FAKE copied to clipboard
There was a problem while setting up the environment
I guess my problem is the same as this one (I'm following the install instructions from here
❯ dotnet fake -v build
runOrBuild ({ Script = None
ScriptArguments = []
FsiArgLine = []
Debug = false
NoCache = false
RestoreOnlyGroup = false
VerboseLevel = Verbose
IsBuild = true })
FAKE 5 - F# Make (5.21.0-alpha004) (this line is written to standard error, see https://github.com/fsharp/FAKE/issues/2066)
prepareAndRunScriptRedirect(Script: /home/mattias/fsharp/FsAutoComplete/build.fsx, fsiOptions: "")
Writing '/home/mattias/fsharp/FsAutoComplete/.fake/build.fsx/intellisense.fsx'
Restoring with paket...
The last restore is still up to date. Nothing left to do.
Retrieving the assemblies (rid: 'ubuntu.20.04-x64')...
Calculating the runtime graph...
Loaded runtime json from: microsoft.netcore.platforms-6.0.1
Performance:
- Cli parsing: 223 milliseconds
- Packages: 2 seconds
- Creating Runtime Graph: 49 milliseconds
- Retrieve Assembly List: 2 seconds
- Runtime: 2 seconds
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: '/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0', please check installed SDK and runtime versions
StackTrace:
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1439.Invoke(String message) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\printf.fs:line 1439
at Fake.Runtime.FakeRuntime.retrieveInfosUncached@114(String cacheDir, Lazy`1 paketDependenciesFile, VerboseLevel logLevel, GroupName groupName, SdkAssemblyResolver sdkAssemblyResolver, FrameworkIdentifier framework, Rid rid, Rid ridNotVersionSpecific, Lazy`1 lockFile, Lazy`1 cache, Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 206
at [email protected](Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 312
at Fake.Runtime.CoreCache.getCached[a](FSharpFunc`2 getUncached, FSharpFunc`2 readFromCache, FSharpFunc`2 writeToCache, FSharpFunc`2 checkCacheUpToDate) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\CoreCache.fs:line 41
at Fake.Runtime.FakeRuntime.getKnownDependencies@310(String cacheDir, Lazy`1 paketDependenciesFile, VerboseLevel logLevel, GroupName groupName, FileInfo lockFilePath, String dependencyCacheHashFile, String dependencyCacheFile, SdkAssemblyResolver sdkAssemblyResolver, FrameworkIdentifier framework, Rid rid, Rid ridNotVersionSpecific, Lazy`1 lockFile, Lazy`1 cache, Lazy`1 writeIntellisenseTask, FSharpFunc`2 readFromCache, FSharpFunc`2 writeToCache, Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 311
at [email protected](Unit unitVar) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 320
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at Fake.Runtime.FakeRuntime.paketCachingProvider(FakeConfig config, String cacheDir, Dependencies paketApi, Lazy`1 paketDependenciesFile, FSharpOption`1 group) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 323
at Fake.Runtime.FakeRuntime.runScript(PrepareInfo preparedScript) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 579
at Program.runOrBuild(RunArguments args) in D:\a\FAKE\FAKE\src\app\Fake.netcore\Program.fs:line 156
Hint: If you just upgraded the fake-runner you can try to remove the .fake directory and try again.
I'm just starting with dotnet so I have no idea what I should do to be able to install it
My issue is that my dotnet version is 6.0.101 so the issue is that there is no /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0. I
do have /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.1/ref/net6.0/
but I don't know how to tell FAKE to look for it.
I tried adding the proper path in FAKE_SDK_RESOLVER_CUSTOM_DOTNET_PATH
(with FAKE_SDK_RESOLVER_CUSTOM_DOTNET_PATH="/usr/share/dotnet:$FAKE_SDK_RESOLVER_CUSTOM_DOTNET_PATH"
) and even ln -s /usr/share/dotnet /usr/local/share/dotnet
but it doesn't work.
Originally posted by @mattiasdrp in https://github.com/fsprojects/FAKE/issues/2638#issuecomment-1024901770
Welcome to the FAKE community! Thank you so much for creating your first issue and therefore improving the project!
can you please send the output of dotnet --info
and try with the new 5.21.1
release?
fake version:
❯ dotnet fake --version
FAKE 5 - F# Make (5.21.0-alpha004) (this line is written to standard error, see https://github.com/fsharp/FAKE/issues/2066)
FakePath: /home/mattias/.nuget/packages/fake-cli/5.21.0-alpha004/tools/net6.0/any/Fake.Runtime.dll
Paket.Core: 6.2.1
dotnet info:
❯ dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.101
Commit: ef49f6213a
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /usr/share/dotnet/sdk/6.0.101/
Host (useful for support):
Version: 6.0.1
Commit: 3a25a7f1cc
.NET SDKs installed:
6.0.101 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
dotnet fake build
❯ dotnet fake -v build
runOrBuild ({ Script = None
ScriptArguments = []
FsiArgLine = []
Debug = false
NoCache = false
RestoreOnlyGroup = false
VerboseLevel = Verbose
IsBuild = true })
FAKE 5 - F# Make (5.21.0-alpha004) (this line is written to standard error, see https://github.com/fsharp/FAKE/issues/2066)
prepareAndRunScriptRedirect(Script: /home/mattias/fsharp/FsAutoComplete/build.fsx, fsiOptions: "")
Writing '/home/mattias/fsharp/FsAutoComplete/.fake/build.fsx/intellisense.fsx'
Restoring with paket...
The last restore is still up to date. Nothing left to do.
Retrieving the assemblies (rid: 'ubuntu.20.04-x64')...
Calculating the runtime graph...
Loaded runtime json from: microsoft.netcore.platforms-6.0.1
Performance:
- Cli parsing: 481 milliseconds
- Packages: 2 seconds
- Creating Runtime Graph: 106 milliseconds
- Retrieve Assembly List: 2 seconds
- Runtime: 3 seconds
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: '/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0', please check installed SDK and runtime versions
StackTrace:
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1439.Invoke(String message) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\printf.fs:line 1439
at Fake.Runtime.FakeRuntime.retrieveInfosUncached@114(String cacheDir, Lazy`1 paketDependenciesFile, VerboseLevel logLevel, GroupName groupName, SdkAssemblyResolver sdkAssemblyResolver, FrameworkIdentifier framework, Rid rid, Rid ridNotVersionSpecific, Lazy`1 lockFile, Lazy`1 cache, Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 206
at [email protected](Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 312
at Fake.Runtime.CoreCache.getCached[a](FSharpFunc`2 getUncached, FSharpFunc`2 readFromCache, FSharpFunc`2 writeToCache, FSharpFunc`2 checkCacheUpToDate) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\CoreCache.fs:line 41
at Fake.Runtime.FakeRuntime.getKnownDependencies@310(String cacheDir, Lazy`1 paketDependenciesFile, VerboseLevel logLevel, GroupName groupName, FileInfo lockFilePath, String dependencyCacheHashFile, String dependencyCacheFile, SdkAssemblyResolver sdkAssemblyResolver, FrameworkIdentifier framework, Rid rid, Rid ridNotVersionSpecific, Lazy`1 lockFile, Lazy`1 cache, Lazy`1 writeIntellisenseTask, FSharpFunc`2 readFromCache, FSharpFunc`2 writeToCache, Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 311
at [email protected](Unit unitVar) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 320
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at Fake.Runtime.FakeRuntime.paketCachingProvider(FakeConfig config, String cacheDir, Dependencies paketApi, Lazy`1 paketDependenciesFile, FSharpOption`1 group) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 323
at Fake.Runtime.FakeRuntime.runScript(PrepareInfo preparedScript) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 579
at Program.runOrBuild(RunArguments args) in D:\a\FAKE\FAKE\src\app\Fake.netcore\Program.fs:line 156
Hint: If you just upgraded the fake-runner you can try to remove the .fake directory and try again.
I don't know anything about F# ecosystem, how should I build the 5.21.1 release?
@mattiasdrp you can update your version with dotnet tool update fake-cli
to update to 5.21.1, the latest stable version.
Thanks ;-) Same issue:
Clean
❯ rm -rf .fake
Build
❯ dotnet fake -v build
runOrBuild ({ Script = None
ScriptArguments = []
FsiArgLine = []
Debug = false
NoCache = false
RestoreOnlyGroup = false
VerboseLevel = Verbose
IsBuild = true })
FAKE 5 - F# Make (5.21.1) (this line is written to standard error, see https://github.com/fsharp/FAKE/issues/2066)
prepareAndRunScriptRedirect(Script: /home/mattias/fsharp/FsAutoComplete/build.fsx, fsiOptions: "")
Writing '/home/mattias/fsharp/FsAutoComplete/.fake/build.fsx/intellisense.fsx'
Restoring with paket...
The last restore is still up to date. Nothing left to do.
Retrieving the assemblies (rid: 'ubuntu.20.04-x64')...
Using .Net 6 assemblies
Trying to resolve runtime version from network..
Calculating the runtime graph...
Loaded runtime json from: microsoft.netcore.platforms-6.0.1
resolved runtime version: 6.0.0
Resolved referenced SDK path: /usr/bin/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0
Performance:
- Cli parsing: 198 milliseconds
- Packages: 2 seconds
- Creating Runtime Graph: 47 milliseconds
- Retrieve Assembly List: 2 seconds
- Script analyzing: 185 milliseconds
- Runtime: 2 seconds
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: '/usr/bin/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0', please check installed SDK and runtime versions
StackTrace:
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1439.Invoke(String message) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\printf.fs:line 1439
at Fake.Runtime.FakeRuntime.retrieveInfosUncached@114(String cacheDir, Lazy`1 paketDependenciesFile, VerboseLevel logLevel, GroupName groupName, SdkAssemblyResolver sdkAssemblyResolver, FrameworkIdentifier framework, Rid rid, Rid ridNotVersionSpecific, Lazy`1 lockFile, Lazy`1 cache, Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 202
at [email protected](Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 312
at Fake.Runtime.CoreCache.getCached[a](FSharpFunc`2 getUncached, FSharpFunc`2 readFromCache, FSharpFunc`2 writeToCache, FSharpFunc`2 checkCacheUpToDate) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\CoreCache.fs:line 41
at Fake.Runtime.FakeRuntime.getKnownDependencies@310(String cacheDir, Lazy`1 paketDependenciesFile, VerboseLevel logLevel, GroupName groupName, FileInfo lockFilePath, String dependencyCacheHashFile, String dependencyCacheFile, SdkAssemblyResolver sdkAssemblyResolver, FrameworkIdentifier framework, Rid rid, Rid ridNotVersionSpecific, Lazy`1 lockFile, Lazy`1 cache, Lazy`1 writeIntellisenseTask, FSharpFunc`2 readFromCache, FSharpFunc`2 writeToCache, Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 311
at [email protected](Unit unitVar) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 320
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at Fake.Runtime.FakeRuntime.paketCachingProvider(FakeConfig config, String cacheDir, Dependencies paketApi, Lazy`1 paketDependenciesFile, FSharpOption`1 group) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 323
at Fake.Runtime.FakeRuntime.runScript(PrepareInfo preparedScript) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 579
at Program.runOrBuild(RunArguments args) in D:\a\FAKE\FAKE\src\app\Fake.netcore\Program.fs:line 156
Hint: If you just upgraded the fake-runner you can try to remove the .fake directory and try again.
Info:
❯ dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.101
Commit: ef49f6213a
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /usr/share/dotnet/sdk/6.0.101/
Host (useful for support):
Version: 6.0.1
Commit: 3a25a7f1cc
.NET SDKs installed:
6.0.101 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
@mattiasdrp can you please check your environment variables? Specifically PATH
, DOTNET_HOST_PATH
, DOTNET_ROOT
, and DOTNET_ROOT(x86)
? Do you see an entry with /usr/bin/dotnet
?
The default locations for linux is /usr/share/dotnet/
and mac is /usr/local/share/dotnet
? But the resolved path from logs is usr/bin/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0
And in the resolution algorithm, we look for environment variables before default installation. So maybe you have an entry in one of these environment variables that got resolved by algorithm.
Sure!
❯ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib
❯ printenv | grep "DOTNET"
The default locations for linux is
/usr/share/dotnet/
and mac is/usr/local/share/dotnet
? But the resolved path from logs isusr/bin/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0
My issue is that my dotnet version is 6.0.101 so there is no /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0.
whereas there is /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.1/ref/net6.0/
, can it be related to that?
Can you please check if you have this path in your file system?
usr/bin/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0
Or if you have at least dotnet
host in usr/bin
?
I have dotnet in usr/bin:
❯ la /usr/bin/dotnet
lrwxrwxrwx 1 root root 22 Nov 17 19:53 /usr/bin/dotnet -> ../share/dotnet/dotnet
I don't have usr/bin/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0
@mattiasdrp You have a symlink from usr/bin
to share/dotnet
. In the algorithm, we use to resolve reference assemblies we don't follow symlinks. Can you please remove the symlink and try? Because from dotnet --info
output, SDKs are installed in usr/share/dotnet
which is the original path in symlink
cc: @baronfel
Correct, if dotnet
is a symlink the symlink should be followed to its root before doing the directory probing algorithm.
Hi, thanks for your answer ;-)
Build failing again. Once again it tries to find /usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0 when it should find /usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.1/ref/net6.0 (6.0.0 instead of 6.0.1).
❯ dotnet fake -v build
runOrBuild ({ Script = None
ScriptArguments = []
FsiArgLine = []
Debug = false
NoCache = false
RestoreOnlyGroup = false
VerboseLevel = Verbose
IsBuild = true })
FAKE 5 - F# Make (5.21.1) (this line is written to standard error, see https://github.com/fsharp/FAKE/issues/2066)
prepareAndRunScriptRedirect(Script: /home/mattias/fsharp/FsAutoComplete/build.fsx, fsiOptions: "")
Writing '/home/mattias/fsharp/FsAutoComplete/.fake/build.fsx/intellisense.fsx'
Restoring with paket...
The last restore is still up to date. Nothing left to do.
Retrieving the assemblies (rid: 'ubuntu.20.04-x64')...
Using .Net 6 assemblies
Trying to resolve runtime version from network..
Calculating the runtime graph...
Loaded runtime json from: microsoft.netcore.platforms-6.0.1
resolved runtime version: 6.0.0
Resolved referenced SDK path: /usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0
Performance:
- Cli parsing: 292 milliseconds
- Packages: 2 seconds
- Creating Runtime Graph: 101 milliseconds
- Retrieve Assembly List: 2 seconds
- Runtime: 3 seconds
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: '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0', please check installed SDK and runtime versions
StackTrace:
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1439.Invoke(String message) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\printf.fs:line 1439
at Fake.Runtime.FakeRuntime.retrieveInfosUncached@114(String cacheDir, Lazy`1 paketDependenciesFile, VerboseLevel logLevel, GroupName groupName, SdkAssemblyResolver sdkAssemblyResolver, FrameworkIdentifier framework, Rid rid, Rid ridNotVersionSpecific, Lazy`1 lockFile, Lazy`1 cache, Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 202
at [email protected](Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 312
at Fake.Runtime.CoreCache.getCached[a](FSharpFunc`2 getUncached, FSharpFunc`2 readFromCache, FSharpFunc`2 writeToCache, FSharpFunc`2 checkCacheUpToDate) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\CoreCache.fs:line 41
at Fake.Runtime.FakeRuntime.getKnownDependencies@310(String cacheDir, Lazy`1 paketDependenciesFile, VerboseLevel logLevel, GroupName groupName, FileInfo lockFilePath, String dependencyCacheHashFile, String dependencyCacheFile, SdkAssemblyResolver sdkAssemblyResolver, FrameworkIdentifier framework, Rid rid, Rid ridNotVersionSpecific, Lazy`1 lockFile, Lazy`1 cache, Lazy`1 writeIntellisenseTask, FSharpFunc`2 readFromCache, FSharpFunc`2 writeToCache, Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 311
at [email protected](Unit unitVar) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 320
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at Fake.Runtime.FakeRuntime.paketCachingProvider(FakeConfig config, String cacheDir, Dependencies paketApi, Lazy`1 paketDependenciesFile, FSharpOption`1 group) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 323
at Fake.Runtime.FakeRuntime.runScript(PrepareInfo preparedScript) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 579
at Program.runOrBuild(RunArguments args) in D:\a\FAKE\FAKE\src\app\Fake.netcore\Program.fs:line 156
Hint: If you just upgraded the fake-runner you can try to remove the .fake directory and try again.
Dotnet info:
❯ dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.101
Commit: ef49f6213a
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /usr/share/dotnet/sdk/6.0.101/
Host (useful for support):
Version: 6.0.1
Commit: 3a25a7f1cc
.NET SDKs installed:
6.0.101 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Path:
❯ echo $PATH
/usr/share/dotnet:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib
I'm having some problems after trying to update FAKE while setting the environment up too
❯ dotnet fake -v run build.fsx
runOrBuild ({ Script = Some "build.fsx"
ScriptArguments = []
FsiArgLine = []
Debug = false
NoCache = false
RestoreOnlyGroup = false
VerboseLevel = Verbose
IsBuild = false })
FAKE 5 - F# Make (5.21.1) (this line is written to standard error, see https://github.com/fsharp/FAKE/issues/2066)
prepareAndRunScriptRedirect(Script: build.fsx, fsiOptions: "")
Writing 'C:\d\Astrorex.Api\.fake\build.fsx\intellisense.fsx'
Restoring with paket...
The last restore is still up to date. Nothing left to do.
Retrieving the assemblies (rid: 'win10-x64')...
Performance:
- Cli parsing: 243 milliseconds
- Packages: 298 milliseconds
- Retrieve Assembly List: 10 milliseconds
- Runtime: 798 milliseconds
There was a problem while setting up the environment, see standard error for details.
There was a problem while setting up the environment:
-> FormatException: Invalid version: 6.0
StackTrace:
at Microsoft.Deployment.DotNet.Releases.ReleaseVersion..ctor(String version)
at Fake.Runtime.SdkAssemblyResolver.SdkAssemblyResolver.IsSdkVersionFromGlobalJsonSameAsSdkVersion() in D:\a\FAKE\FAKE\src\app\Fake.Runtime\SdkAssemblyResolver.fs:line 50
at Fake.Runtime.SdkAssemblyResolver.SdkAssemblyResolver.ResolveSdkReferenceAssemblies(GroupName groupName, Lazy`1 paketDependenciesFile) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\SdkAssemblyResolver.fs:line 319
at Fake.Runtime.FakeRuntime.retrieveInfosUncached@114(String cacheDir, Lazy`1 paketDependenciesFile, VerboseLevel logLevel, GroupName groupName, SdkAssemblyResolver sdkAssemblyResolver, FrameworkIdentifier framework, Rid rid, Rid ridNotVersionSpecific, Lazy`1 lockFile, Lazy`1 cache, Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 202
at [email protected](Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 312
at Fake.Runtime.CoreCache.getCached[a](FSharpFunc`2 getUncached, FSharpFunc`2 readFromCache, FSharpFunc`2 writeToCache, FSharpFunc`2 checkCacheUpToDate) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\CoreCache.fs:line 41
at Fake.Runtime.FakeRuntime.getKnownDependencies@310(String cacheDir, Lazy`1 paketDependenciesFile, VerboseLevel logLevel, GroupName groupName, FileInfo lockFilePath, String dependencyCacheHashFile, String dependencyCacheFile, SdkAssemblyResolver sdkAssemblyResolver, FrameworkIdentifier framework, Rid rid, Rid ridNotVersionSpecific, Lazy`1 lockFile, Lazy`1 cache, Lazy`1 writeIntellisenseTask, FSharpFunc`2 readFromCache, FSharpFunc`2 writeToCache, Unit unitVar0) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 311
at [email protected](Unit unitVar) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 320
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at Fake.Runtime.FakeRuntime.paketCachingProvider(FakeConfig config, String cacheDir, Dependencies paketApi, Lazy`1 paketDependenciesFile, FSharpOption`1 group) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 323
at Fake.Runtime.FakeRuntime.runScript(PrepareInfo preparedScript) in D:\a\FAKE\FAKE\src\app\Fake.Runtime\FakeRuntime.fs:line 579
at Program.runOrBuild(RunArguments args) in D:\a\FAKE\FAKE\src\app\Fake.netcore\Program.fs:line 156
Hint: If you just upgraded the fake-runner you can try to remove the .fake directory and try again.
More info:
❯ dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.101
Commit: ef49f6213a
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.101\
Host (useful for support):
Version: 6.0.1
Commit: 3a25a7f1cc
.NET SDKs installed:
3.1.302 [C:\Program Files\dotnet\sdk]
5.0.300 [C:\Program Files\dotnet\sdk]
6.0.101 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Not sure if this is related but what helped in my case was setting the framework to net6.0
in my paket.dependencies file:
group Build
source https://api.nuget.org/v3/index.json
storage: none
framework: net6.0
nuget FSharp.Core
nuget Fake.Core.Target
nuget Fake.IO.FileSystem
nuget Fake.JavaScript.Yarn
nuget Fake.DotNet.Cli
nuget Fake.IO.Zip
nuget Fake.Tools.Git
nuget CliWrap
nuget FSharp.Control.Reactive
before it was netstandard2.0
and I was getting similar problems.
Oh, and your global.json
really needs to be on point as well.
Ran into this issue on Ubuntu 20.04 with dotnet SDK 6.0.200.
How to reproduce
First create a skeleton project. I've found it needs some actual source code to run into this issue, but that could be anecdotal since I tried many different things.
mkdir fake-test
cd fake-test
dotnet new fake # Yes/Yes when prompted
dotnet tool install paket
mkdir proj
dotnet new console --language F# --output proj
dotnet fake build
Everything up until this point works as expected. Here's where the fun begins. If the folder is copied (or cloned as a git repo), and built with a fresh terminal, this error pops up. Let's assume I copied fake-test
over to fake-test-2
:
# Fresh terminal
cd fake-test-2
rm -rf .fake
dotnet fake build
Result:
There was a problem while setting up the environment:
-> Could not find referenced assemblies in path: '/usr/bin/packs/Microsoft.NETCore.App.Ref/6.0.2/ref/net6.0', please check installed SDK and runtime versions
Workaround
This seems to fix the issue in the local environment only:
export DOTNET_HOST_PATH=/usr/share/dotnet/sdk
Environment
$ dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.200
Commit: 4c30de7899
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /usr/share/dotnet/sdk/6.0.200/
Host (useful for support):
Version: 6.0.2
Commit: 839cdfb0ec
.NET SDKs installed:
6.0.200 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/2sComplement/.dotnet/tools
Ran into this today on Ubuntu 20.04 with .NET SDK 6.0.201. Setting the DOTNET_HOST_PATH
environment variable as @2sComplement suggested worked.
Environment
dotnet info
$ dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.201
Commit: ef40e6aa06
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /usr/share/dotnet/sdk/6.0.201/
Host (useful for support):
Version: 6.0.3
Commit: c24d9a9c91
.NET SDKs installed:
6.0.201 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
path
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
I'm trying to build Fable on Debian with .NET 6.0.202 and encountered a similar problem.
It turned out Fable was not using FAKE (😅). But FAKE failed before trying to run
build.fsx
as a FAKE script, so this is still relevant.
It seems like there are two separate issues going on, but one seems to be already fixed in release/next
and the other seems to be a duplicate.
I think this issue may be safe to close?
1. FAKE tries to find the .NET SDK installation from dotnet
, but fails because /usr/bin/dotnet
is a symlink and FAKE doesn't follow it
You would see /usr/bin/packs/
in the error when this happens:
There was a problem while setting up the environment:
-> Could not find referenced assemblies in path: '/usr/bin/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0', please check installed SDK and runtime versions`
This seems to be already fixed in https://github.com/fsprojects/FAKE/commit/aad29e66660c3b36f4dd092c402a198d4ac97a8f, which adds a code to follow symlink when FAKE uses the location of dotnet
to get the .NET root.
The
export DOTNET_HOST_PATH
(orexport DOTNET_ROOT
) workaround fixes this because FAKE does not need to resolve .NET root and skips the above code entirely.
2. FAKE assumes the host version is 6.0.0
, which causes problem on newer hosts
You would see /usr/share/dotnet
in the error when this happens:
There was a problem while setting up the environment:
-> Could not find referenced assemblies in path: '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/6.0.0/ref/net6.0', please check installed SDK and runtime versions
I think this is actually a duplicate of the scenario 3 of #2641.
I tried removing
global.json
in Fable and I'm now seeing a different error, which is becausebuild.fsx
is actually not a FAKE script and is my bad.
Some says
export DOTNET_HOST_PATH
alone fixes this problem, but I assume they are usingglobal.json
with the exact .NET version, or does not useglobal.json
in their project at all.
Environment
.NET SDK (reflecting any global.json):
Version: 6.0.202
Commit: f8a55617d2
Runtime Environment:
OS Name: debian
OS Version: 10
OS Platform: Linux
RID: debian.10-x64
Base Path: /usr/share/dotnet/sdk/6.0.202/
Host (useful for support):
Version: 6.0.4
Commit: be98e88c76
.NET SDKs installed:
3.1.418 [/usr/share/dotnet/sdk]
5.0.407 [/usr/share/dotnet/sdk]
6.0.202 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.24 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.16 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.24 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.16 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
I'm also getting this, but only on Linux. On Windows it works. Removing global.json
makes it work on Linux as well. Not sure why, I tried using 6.0.100 and 6.0.202 in global.json, but the error didn't go away until I removed the globa.json
file.
If you're experiencing this issue on a Mac with a M1 processor (assuming you've installed the x64 version of the .NET SDK). You'll need to create an environment variable named DOTNET_HOST_PATH
and set it's value to /usr/local/share/dotnet/x64/sdk
.
Had the same problem. adding framework: net6.0 in the #r "paket: ..." and removing the global.json fixed it.
I fix my issue with building FSharp.Data by removing global.json It's content was
{
"sdk": {
"version": "6.0.203",
"rollForward": "major"
}
}
dotnet --info
>dotnet --info
.NET SDK:
Version: 8.0.100-preview.6.23330.14
Commit: ba97796b8f
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100-preview.6.23330.14\
.NET workloads installed:
There are no installed workloads to display.
Host:
Version: 8.0.0-preview.6.23329.7
Architecture: x64
Commit: 5340be2ccc
.NET SDKs installed:
3.1.426 [C:\Program Files\dotnet\sdk]
6.0.412 [C:\Program Files\dotnet\sdk]
7.0.109 [C:\Program Files\dotnet\sdk]
7.0.400-preview.23274.1 [C:\Program Files\dotnet\sdk]
8.0.100-preview.5.23303.2 [C:\Program Files\dotnet\sdk]
8.0.100-preview.6.23330.14 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-preview.5.23302.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-preview.6.23329.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-preview.5.23280.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-preview.6.23329.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0-preview.5.23302.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0-preview.6.23329.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
arm64 [C:\Program Files\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation]
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
dotnet --list-sdks
3.1.426 [C:\Program Files\dotnet\sdk]
6.0.412 [C:\Program Files\dotnet\sdk]
7.0.109 [C:\Program Files\dotnet\sdk]
7.0.400-preview.23274.1 [C:\Program Files\dotnet\sdk]
8.0.100-preview.5.23303.2 [C:\Program Files\dotnet\sdk]
8.0.100-preview.6.23330.14 [C:\Program Files\dotnet\sdk]
ls "C:\Program Files\dotnet\sdk"
3.1.426
6.0.412
7.0.109
7.0.400-preview.23274.1
8.0.100-preview.5.23303.2
8.0.100-preview.6.23330.14
NuGetFallbackFolder
ls "%localappdata%\Microsoft\dotnet\sdk-manifests"
6.0.300
7.0.100
> ls "C:\Program Files (x86)\dotnet\packs\Microsoft.NETCore.App.Ref"
6.0.16
7.0.5
8.0.0-preview.5.23280.8
I did have following error
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.5\ref\net6.0', please check installed SDK and runtime versions
I suspect that 6.0.5 comes from required 6.0.203 SDK from global.json