Konrad Viltersten Konrad Viltersten - 21 days ago 7
C# Question

Is UseIISPlatformHandler() deprecated correctly to UseIIS()?

In this place, there's information on changes to Core as follows.

public void Configure(IApplicationBuilder app, ILoggerFactory loggerfactory)
{
...
// Remove call to app.UseIISPlatformHandler(); This is handled by UseIIS in Main.
// Remove call to app.UseForwardedHeaders(); This is handled by UseIIS in Main.
...
}


However, when checking out the contents of the method, there's no such call as UseIIS(). The nearest is the one to UseIISIntegration() but it's commented as if it substitutes UseForwardedHeaders().

public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseServer("Microsoft.AspNetCore.Server.Kestrel")
// Replaces call to UseIISPlatformHandlerUrl()
.UseIISIntegration()
.UseStartup<Startup>()
.Build();

host.Run();
}


What am I misunderstanding?

Answer

The issue is rather old and some things have changed since then. You are on the right track, though.

The UseIISPlatformHandler call indeed moved from Startup to Program start and has been renamed to UseIISIntegration.

Comments