如何在 ubuntu 上并排安装多个版本的 .NET Core [英] How to install multiple versions of .NET Core side by side on ubuntu

查看:47
本文介绍了如何在 ubuntu 上并排安装多个版本的 .NET Core的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个应用程序,用 .NET Core rc2 编写,在接受环境(Linux 服务器)上运行.最近我们的客户运行了他们自己的性能测试,结果完全破坏了应用程序.由于以下几个原因,我们无法自己复制它:1)我们在windows上开发2) 我们已经从 rc2 迁移到 1.0.0.

We have an app, written in .NET Core rc2 running on an acceptance environment (linux server). Recently our client ran their own performance tests, which turned out to completely break the application. We couldn't reproduce it ourselves for several reasons: 1) We develop on windows 2) We have since migrated from rc2 to 1.0.0.

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

On windows we couldn't reproduce in either our new version (1.0.0) or rc2. So we tried to reproduce it on a linux machine. on 1.0.0 we couldn't reproduce their results either, but when we tried to actually test against rc2 (an older version of our app, obviously) we ran into a really annoying problem: I don't seem to be able to install 1.0.0 and rc2 side by side, even though the error message implies it's possible. Below is the error message

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.

Basicly we want to be able to check the version currenly running on acceptance of our app (rc2) on a linux machine, but we are struggling with actually getting rc2 on it.

谢谢.如果有任何不清楚的地方,请在评论中提出您的问题.

Thanks. If anything is unclear, post your question in comments.

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

I tried building it as a standalone deployment, but then I get following error:

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 机器上构建它

This is to be expected as rc2 is actually not installed on the machine, and I want to build it on the linux machine

推荐答案

只需使用 dotnet install 脚本:https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script

这是一个很好的教程:https://www.hanselman.com/blog/SideBySideUserScopedNETCoreInstallationsOnLinuxWithDotnetinstallsh.aspx

这篇关于如何在 ubuntu 上并排安装多个版本的 .NET Core的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆