#348 Implement IISHostingStartup

This commit is contained in:
Chris R 2017-03-27 15:33:54 -07:00
parent 4334fe19f2
commit d6322872ed
3 changed files with 21 additions and 4 deletions

View File

@ -12,7 +12,8 @@
"commandName": "IISExpress", "commandName": "IISExpress",
"launchBrowser": true, "launchBrowser": true,
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Server.IISIntegration"
} }
}, },
"IISSample": { "IISSample": {
@ -24,4 +25,4 @@
} }
} }
} }
} }

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
@ -76,7 +76,6 @@ namespace IISSample
{ {
var host = new WebHostBuilder() var host = new WebHostBuilder()
.UseKestrel() .UseKestrel()
.UseIISIntegration()
.UseStartup<Startup>() .UseStartup<Startup>()
.Build(); .Build();

View File

@ -0,0 +1,17 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Hosting;
[assembly: HostingStartup(typeof(Microsoft.AspNetCore.Server.IISIntegration.IISHostingStartup))]
namespace Microsoft.AspNetCore.Server.IISIntegration
{
public class IISHostingStartup : IHostingStartup
{
public void Configure(IWebHostBuilder builder)
{
builder.UseIISIntegration();
}
}
}