【问题标题】:Windows Server 2008 R2 Co-Hosting Legacy .Net Application with .Net Core ApplicationWindows Server 2008 R2 与 .Net Core 应用程序共同托管旧版 .Net 应用程序
【发布时间】:2017-03-01 21:46:53
【问题描述】:

我有一台运行 Windows Server 2008 R2 的服务器。它目前在 IIS 中运行多个 ASP.NET 4.5.2 应用程序。

我有一个新的 ASP.Net Core 应用程序,我想将它部署到同一服务器上的 IIS。

  1. 这可能吗?
  2. 我需要做什么才能使其正常工作?

在我的 .Net Core 应用程序中,我的主要方法中有以下内容:

public static void Main(string[] args)
{
    var host = new WebHostBuilder()
        .UseKestrel()
        .UseContentRoot(Directory.GetCurrentDirectory())
        .UseIISIntegration()
        .UseStartup<Startup>()
        .UseStructureMap()
        .Build();

    host.Run();
}

我的 project.json 中也有以下内容

"Microsoft.NETCore.App": {
  "version": "1.1.0"
},
"runtimes": {
  "win7-x64": {}
}

我想确保我的 .Net Core 和我的旧 .Net Framework 应用程序不会相互冲突。

【问题讨论】:

    标签: c# asp.net iis asp.net-core .net-4.0


    【解决方案1】:

    我能够按照本教程完成这项工作:https://docs.microsoft.com/en-us/aspnet/core/publishing/iis

    关键是当我在服务器上安装 .NET Core Windows Server Hosting Bundle 时,我没有安装 .Net Core 运行时,因为我的 .Net Core 应用程序是独立的。我通过从命令行安装 Hosting Bundle 并使用以下命令来做到这一点

    DotNetCore.1.0.3_1.1.0-WindowsHosting.exe OPT_INSTALL_LTS_REDIST=0 OPT_INSTALL_FTS_REDIST=0
    

    【讨论】:

      猜你喜欢
      • 2016-04-11
      • 1970-01-01
      • 1970-01-01
      • 2021-11-04
      • 2011-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多