运行 Core 2.0.x 在安装了 2.1 的服务器上

Run Core 2.0.x on server with 2.1 installed

我有一台 Windows Server 2016 安装了 Core 2.1 和一个 2.1 应用程序 运行。我试图在服务器上设置另一个基于 Core 2.0.5 构建的应用程序,但是 运行 给我 IIS 502.5 错误,在 EventViewer 中查看显示错误代码 '0x80004005 : 8000808c

这个错误似乎是因为没有安装正确版本的dotnet Core。 2.1 版本是否不向后兼容 2.0.x,在那种情况下我可以安装最新的 2.0.x 运行时而不影响现有的 2.1 应用程序吗?

尝试 运行 没有 IIS 的应用程序,仅限 Kestrel。在命令行中浏览到应用程序目录并使用 dotnet WebApplication1.dll 启动它(更改为指向正确的 dll)。可能缺少依赖项,它会优雅地通知您。

F:\WebApplication1>dotnet WebApplication1.dll
Error:
  An assembly specified in the application dependencies manifest (WebApplication1.deps.json) was not found:
    package: 'Microsoft.ApplicationInsights.AspNetCore', version: '2.1.1'
    path: 'lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll'
  This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
    aspnetcore-store-2.0.0-linux-x64.xml;aspnetcore-store-2.0.0-osx-x64.xml;aspnetcore-store-2.0.0-win7-x64.xml;aspnetcore-store-2.0.0-win7-x86.xml

您可以根据需要安装任意多 运行 次或 SDK,安装新的时旧的保持不变(反之亦然)。您可以使用命令 dotnet --list-runtimes

列出已安装 运行 次
C:\>dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]