我正在運行 Arch Linux,我希望通過dotnet-install 腳本安裝 .NET 6.0 SDK 。
我已更改腳本的權限以使其成為可執行檔案,然后運行:
./dotnet-install.sh --channel LTS
這是輸出:
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.
dotnet-install: .NET Core SDK version 6.0.102 is already installed.
dotnet-install: Adding to current process PATH: `/home/j/.dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
注意它是如何說SDK version 6.0.102已經安裝的。
但是,當我然后運行時:
~/programs ? dotnet --list-sdks
~/programs ?
如您所見,我沒有得到任何輸出,但是在運行時:
~/programs ? dotnet --list-runtimes
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]
~/programs ?
我列出了運行時。
這里發生了什么?當我嘗試構建代碼時,我得到:
~/code/mechanic360.api main ? dotnet build .
Could not execute because the application was not found or a compatible .NET SDK is not installed.
Possible reasons for this include:
* You intended to execute a .NET program:
The application 'build' does not exist.
* You intended to execute a .NET SDK command:
It was not possible to find any installed .NET SDKs.
Install a .NET SDK from:
https://aka.ms/dotnet-download
~/code/mechanic360.api main ?
如您所見,它找不到 SDK。我錯過了什么?
uj5u.com熱心網友回復:
莫名其妙地遇到了同樣的問題。能夠通過此步驟修復它 https://docs.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
在此之后,我將我的 dotnet 位置重新定位到“/home/”username“/.dotnet/dotnet”,我已準備好構建。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/439508.html
上一篇:下面代碼中的[request.ContinuationToken=response.NextContinuationToken]是什么意思?
下一篇:不支持WPF中的可視狀態管理器
