英文:
Unable to use specific version of .net in ubuntu
问题
Dotnet core已安装在Ubuntu 20.04上,但无法运行dotnet程序
我在我的本地机器上安装了Dotnet(Ubuntu 20.04),但无法运行任何东西。错误消息是当我运行一个.cs程序时,我收到以下错误,说我需要6.0.0版本:
但在同一个文件夹中,我已经安装了dotnet(包括.NET SDK 7.0.302和.NET Runtime 7.0.5),当我运行dotnet --info时显示如下:
当尝试安装6.0时,我得到一条消息,说“dotnet-install: .NET Core SDK 版本为'6.0.408'已经安装。”
使用以下链接进行安装,但将最后一条命令更改为6.0版本:https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
我真的非常感谢任何帮助来安装这个。这真的非常令人沮丧。大多数在线指南和这里的问题都结束于安装。
英文:
Dotnet core installed in Ubuntu 20.04 but unable to run dotnet program
I have Dotnet installed on my local machine (Ubuntu 20.04) but am unable to run anything. The error message is When I run a .cs program, I get the following error saying I Need 6.0.0:
But at the same folder, I have dotnet installed (both the .NET SDK 7.0.302 and and .Net runtime 7.0.5) when asked the dotnet --info
When trying to install 6.0, I gt a message saying "dotnet-install: .NET Core SDK with version '6.0.408' is already installed."
Used this link to install but changed the last command to 6.0: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
I'd really appreciate any help installing this. This is extremely frustrating. Most guides online and questions here ended with installation.
答案1
得分: 1
我用以下链接解决了这个问题:
https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#manual-install
我将7改成了6。
export DOTNET_ROOT=$(pwd)/.dotnet
mkdir -p "$DOTNET_ROOT" && tar zxf "$DOTNET_FILE" -C "$DOTNET_ROOT"
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools```
<details>
<summary>英文:</summary>
I resolved this issue with the following link:
https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#manual-install
I changed the 7 to a 6.
```DOTNET_FILE=dotnet-sdk-6.0.100-linux-x64.tar.gz
export DOTNET_ROOT=$(pwd)/.dotnet
mkdir -p "$DOTNET_ROOT" && tar zxf "$DOTNET_FILE" -C "$DOTNET_ROOT"
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools```
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论