无法在Ubuntu中使用特定版本的.NET。

huangapple go评论54阅读模式
英文:

Unable to use specific version of .net in ubuntu

问题

Dotnet core已安装在Ubuntu 20.04上,但无法运行dotnet程序

我在我的本地机器上安装了Dotnet(Ubuntu 20.04),但无法运行任何东西。错误消息是当我运行一个.cs程序时,我收到以下错误,说我需要6.0.0版本:
无法在Ubuntu中使用特定版本的.NET。

但在同一个文件夹中,我已经安装了dotnet(包括.NET SDK 7.0.302和.NET Runtime 7.0.5),当我运行dotnet --info时显示如下:
无法在Ubuntu中使用特定版本的.NET。

当尝试安装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:
无法在Ubuntu中使用特定版本的.NET。

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
无法在Ubuntu中使用特定版本的.NET。

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 &quot;$DOTNET_ROOT&quot; &amp;&amp; tar zxf &quot;$DOTNET_FILE&quot; -C &quot;$DOTNET_ROOT&quot;

export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools```

</details>



huangapple
  • 本文由 发表于 2023年6月1日 03:13:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76376602.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定