我安装了dotnet-sdk-7.0台,一切都运行得很好.昨天我从Microsoft软件包库安装了dotnet-sdk-8.0,首先从我的发行版中删除了现有的.NET包:sudo apt remove 'dotnet*' 'aspnet*' 'netstandard*' 现在莱德不能运行我的项目了.

我的系统:Ubuntu 22.04.3 LTS

dotnet --info:

.NET SDK:
 Version:           8.0.100
 Commit:            57efcf1350
 Workload version:  8.0.100-manifests.6c33ef20

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/8.0.100/

.NET workloads installed:
 Workload version: 8.0.100-manifests.6c33ef20
There are no installed workloads to display.

Host:
  Version:      8.0.0
  Architecture: x64
  Commit:       5535e31a71

.NET SDKs installed:
  8.0.100 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Toolset and Build:enter image description here

骑手错误:

/.../Project/src/Xxx.GraphQl/bin/Debug/net8.0/DataGateway.GraphQl
You must install .NET to run this application.

App: /.../Project/src/Xxx.GraphQl/bin/Debug/net8.0/DataGateway.GraphQl
Architecture: x64
App host version: 8.0.0
.NET location: Not found

Learn more:
https://aka.ms/dotnet/app-launch-failed

Download the .NET runtime:
https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=linux-x64&os=ubuntu.22.04&apphost_version=8.0.0

Process finished with exit code 131.

有什么主意吗?

推荐答案

也遇到了完全一样的问题.对我来说,解决方案是编辑

/etc/dotnet/install_location
/etc/dotnet/install_location_x64

/usr/share/dotnet个而不是/usr/lib/dotnet

在那之后,一切都运转得很好.

.net相关问答推荐

PowerShell中窗体定时器和系统定时器的统一处理

防止在 .NET 上构建路径中的反斜杠以进行跨平台部署

在 Git for Visual Studio 2012 中恢复到以前的提交

Gacutil.exe 成功添加程序集,但在资源管理器中无法查看程序集.为什么?

如何让 DateTimePicker 显示一个空字符串?

使用只读属性或方法?

如何对无法加载的 VSTO 插件进行故障排除?

.NET 如何判断路径是否是文件而不是目录?

.NET 反射的成本是多少?

C# 的浮点比较函数

如何异步 Files.ReadAllLines 并等待结果?

如何在 RabbitMQ 中设置重试次数?

为什么 C# 不推断我的泛型类型?

在 C#/.NET 中组合路径和文件名的最佳方法是什么?

用 double 替换 int 时的 Visual Studio 长编译

找不到库 hostpolicy.dll

为什么 !0 是 Microsoft 中间语言 (MSIL) 中的一种类型?

如何获取当前的 ProcessID?

如何从 HashSet 中检索实际项目?

浮动与双重性能