简体   繁体   English

.net核心托管-服务器已安装两个.net核心运行时

[英].net core hosting - server has two .net core runtimes installed

Our app was originally built with .net core 1.x. 我们的应用最初是使用.net core 1.x构建的。 We would like to upgrade to .net core 2.0. 我们想升级到.net core 2.0。

I installed the hosting bundle from here . 我从这里安装了主机捆绑包。 But now I have the 1.0.0 Runtime and 2.0.5 runtime installed. 但是现在我安装了1.0.0运行时和2.0.5运行时。

在此处输入图片说明

  1. Do I need to uninstall the 1.0.0 runtime? 我需要卸载1.0.0运行时吗?
  2. How can I tell which runtime my app will use? 如何确定我的应用将使用哪个运行时?

The short answer is that you should read the documentation for .NET Core. 简短的答案是,您应该阅读.NET Core的文档。 As Scott Hanselman (PM of the ASP.NET Core team) has pointed out, multiple versions of the .NET Core runtime can be installed side by side without issue 正如Scott Hanselman(ASP.NET Core团队的负责人)指出的那样, 可以并排安装多个版本的.NET Core运行时,而不会出现问题。

As user Camilo Terevinto pointed out in their comment, the highest version of the runtime will be used when your app is started. 正如用户Camilo Terevinto在其评论中指出的那样,启动应用程序时将使用最高版本的运行时。

Microsoft has placed a limited life on the 1.0.0 runtime. Microsoft在1.0.0运行时上设置了有限的生命。 Since 2.0.0 introduced major changes, that break applications written in 1.0.0. 由于2.0.0引入了重大更改,因此破坏了用1.0.0编写的应用程序。 For a more sustainable environment, you should remove the older runtime, then ensure the latest runtime and hosted core package are installed. 为了获得更可持续的环境,您应该删除较旧的运行时,然后确保安装了最新的运行时和托管的核心程序包。 Those can be found on the document page. 这些可以在文档页面上找到。

To determine the runtime your application is utilizing, you can find that information within your project. 要确定应用程序正在使用的运行时,可以在项目中找到该信息。 The assembly will include the information of which framework you're actually targeting against. 该程序集将包含您实际针对哪个框架的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM