jkruer01
jkruer01

Reputation: 2205

Windows Server 2008 R2 Co-Hosting Legacy .Net Application with .Net Core Application

I have a server running Windows Server 2008 R2. It is currently running several ASP.NET 4.5.2 applications within IIS.

I have a new ASP.Net Core Application that I want to deploy to IIS on the same server.

  1. Is this Possible?
  2. What do I need to do in order to make it work?

In my .Net Core Application I have the following in my Main Method:

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

    host.Run();
}

I also have the following in my project.json

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

I want to make sure that my .Net Core and my legacy .Net Framework applications do not conflict with each other.

Upvotes: 2

Views: 680

Answers (1)

jkruer01
jkruer01

Reputation: 2205

I was able to get this working by following this tutorial: https://learn.microsoft.com/en-us/aspnet/core/publishing/iis

The key was that when I installed the .NET Core Windows Server Hosting Bundle on the server I did not install the .Net Core runtime since my .Net Core appliation was self-contained. I did this by installing the Hosting Bundle from the command line and used the following command

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

Upvotes: 1

Related Questions