gpt4 book ai didi

ubuntu - 如何在 ubuntu 上并排安装多个版本的 .NET Core

转载 作者:太空宇宙 更新时间:2023-11-03 16:44:53 24 4
gpt4 key购买 nike

我们有一个应用程序,用 .NET Core rc2 编写,运行在验收环境(Linux 服务器)上。最近我们的客户运行了他们自己的性能测试,结果完全破坏了应用程序。由于以下几个原因,我们无法自己复制它:

  1. 我们在 Windows 上开发
  2. 我们已经从 rc2 迁移到 1.0.0。

在 Windows 上,我们无法在新版本 (1.0.0) 或 rc2 中重现。所以我们尝试在 linux 机器上重现它。在 1.0.0 上我们也无法重现他们的结果,但是当我们尝试针对 rc2(显然是我们应用程序的旧版本)进行实际测试时,我们遇到了一个非常烦人的问题:我似乎无法安装1.0.0 和 rc2 并排,即使错误消息暗示这是可能的。下面是错误信息

The specified framework 'Microsoft.NETCore.App', version '1.0.0-rc2-3002702' was not found.
- Check application dependencies and target a framework version installed at:
/usr/share/dotnet/shared/Microsoft.NETCore.App
- The following versions are installed:
1.0.0
- Alternatively, install the framework version '1.0.0-rc2-3002702'.

基本上,我们希望能够检查在 Linux 机器上接受我们的应用程序 (rc2) 时当前运行的版本,但我们正在努力在其上实际安装 rc2。

谢谢。如果有任何不清楚的地方,请在评论中发表您的问题。

编辑:我尝试将其构建为独立部署,但随后出现以下错误:

Errors in /home/nicolaas/Projects/digipolis-survey-engine/Digipolis.FormEngine/Digipolis.FormEngine.Response.API/project.json
System.AppContext 4.1.0-rc2-24027 provides a compile-time reference assembly for System.AppContext on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with ubuntu.15.10-x64.
System.Runtime.InteropServices.RuntimeInformation 4.0.0-rc2-24027 provides a compile-time reference assembly for System.Runtime.InteropServices.RuntimeInformation on .NETCoreApp,Version=v1.0, but there is no run-time assembly compatible with ubuntu.15.10-x64.
One or more packages are incompatible with .NETCoreApp,Version=v1.0 (ubuntu.15.10-x64).

这是意料之中的,因为机器上实际上没有安装 rc2,我想在 linux 机器上构建它

最佳答案

https://dotnet.microsoft.com/download/dotnet 下载 tar.gz 包并使用此命令安装软件包:

mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-6.0.100-preview.3.21202.5-linux-x64.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet

scound 版本将添加到 sdks 文件夹中,您可以通过运行来确认安装:

dotnet --list-sdks

我发现所有其他解决方案都无用且难以使用并且 dotnet-install脚本很难使用且毫无意义。

关于ubuntu - 如何在 ubuntu 上并排安装多个版本的 .NET Core,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39233865/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com