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

时间:2018-06-08 10:22:36

标签: .net-core asp.net-core-2.0 asp.net-core-2.1

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

此错误似乎指出未安装正确版本的dotnet Core。 2.1版本是否与2.0.x不向后兼容,在这种情况下,我是否可以安装最新的2.0.x运行时而不会干扰现有的2.1应用程序?

1 个答案:

答案 0 :(得分:1)

尝试在没有IIS的情况下运行应用程序,仅限Kestrel。在命令行中浏览到app目录并使用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,当安装新旧运行时或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]