【发布时间】:2016-11-12 22:41:01
【问题描述】:
在this place 中,有关于Core 更改的信息如下。
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.
...
}
但是,当检查方法的内容时,没有像 UseIIS() 这样的调用。最接近的是 UseIISIntegration() 的那个,但它被注释为好像它替代了 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();
}
我误会了什么?
【问题讨论】:
-
您确定您拥有最新的 ASP.NET Core 工具吗?如果我创建一个项目(我有最新的),我看不到这些 cmets。是的,UseIISIntegration 是正确的
-
@CamiloTerevinto 哦,如果我不清楚,对不起。 cmets 在我链接到的项目站点上的代码示例中可见。我猜,就像你说的,这是一个过时的版本。谷歌不知道哪个是“最新的”,我太无知了,无法决定。因此混乱。我想您可以将其发布为回复,以便我接受。
标签: c# iis asp.net-core