什么是 Kestrel(与 IIS/Express) [英] What is Kestrel (vs IIS / Express)

查看:34
本文介绍了什么是 Kestrel(与 IIS/Express)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是 kestrel 网络服务器,它与 IIS/IIS Express 有什么关系?

What is the kestrel web server and how does it relate to IIS / IIS Express?

我在 IIS Express 上开发应用程序并将它们托管在 IIS Web 服务器上.使用 ASP.NET Core,我依赖于 Microsoft.AspNetCore.Server.Kestrel,我的启动有 .UseServer("Microsoft.AspNetCore.Server.Kestrel").但是当我运行我的网站时,我仍然在系统托盘中看到 IIS Express 图标.有人问我是使用 IIS Express 还是 Kestrel,我不知道该说什么!

I come from developing apps on IIS Express and hosting them on an IIS web server. With ASP.NET Core I have a dependency on Microsoft.AspNetCore.Server.Kestrel and my startup has .UseServer("Microsoft.AspNetCore.Server.Kestrel"). But when I run my website, I still get the IIS Express icon in the system tray. Someone asked me if I was using IIS Express or Kestrel and I didn't know what to say!

当我在 PC 上开发并在 Azure 中托管时,我没有任何跨平台要求,所以我什至需要 Kestrel,我很困惑,但似乎没有另一种选择 - 即使是最简单的样本也使用 Kestrel.

I don't have any cross-platform requirements as I develop on a PC and host in Azure, so I'm confused if I even need Kestrel, but it doesn't seem like there's an alternative - even the simplest samples use Kestrel.

推荐答案

什么是红隼

这是一个完整的网络服务器.您可以仅使用 Kestrel 运行您的 ASP.NET Core 应用程序.

It's a full blown web server. You can run your ASP.NET Core application using just Kestrel.

但是当我运行我的网站时,我仍然在系统托盘中看到 IIS Express 图标

But when I run my website, I still get the IIS Express icon in the system tray

在您的 ASP.NET 应用程序中,可能在 wwwroot 目录中,您将看到包含以下内容的 web.config:

In your ASP.NET application, probably in the wwwroot directory, you'll see a web.config that contains this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
    <handlers>
    <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
    </handlers>
    <httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
</configuration>

这是 HttpPlatformHandler.本质上,它所做的是将所有请求转发给 Kestrel.IIS Express(以及 IIS 就此而言)将不再运行 ASP.NET 本身.相反,它们将充当代理,简单地从 Kestrel 来回传递请求和响应.使用 IIS 还是有优势的,特别是它为您提供了安全配置、内核级缓存等.

This is the HttpPlatformHandler. Essentially, what this does is forward all requests to Kestrel. IIS Express (and IIS for that matter) will not run ASP.NET themselves anymore. Instead, they will act as proxies that simply pass requests and responses back and forth from Kestrel. There is still advantages of using IIS, specifically it gives you security configuration, kernel-level caching, etc.

这篇关于什么是 Kestrel(与 IIS/Express)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆