Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 403
Konrad Viltersten Avatar asked Nov 12 '16 22:11

Konrad Viltersten


1 Answers

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.

like image 124
Henk Mollema Avatar answered Oct 31 '22 11:10

Henk Mollema