什么是Kestrel(相对于IIS/Express) [英] What is Kestrel (vs IIS / Express)

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

问题描述

什么是Kestrel Web服务器?它与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中托管时,我没有任何跨平台要求,因此,即使我need Kestrel,我也感到困惑,但是似乎没有其他选择-甚至最简单的样品使用红est.

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.

推荐答案

什么是茶est

What is Kestrel

这是功能强大的Web服务器.您可以仅使用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.本质上,这是将 all 请求转发给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天全站免登陆