问题标签 [kestrel]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
1010 浏览

iis - iis 作为 kestrel 的反向代理服务器

我想使用 iis 作为我的 asp.net core 1.x 应用程序的反向代理,并且可以在服务器中使用http://localhost:5000 url,并且可以在 Internet 上使用http://example.com 但是有是一个让我做不到的问题。这是program.cs:

这是我的 web.config:

我的问题是什么?为什么它不起作用?

0 投票
0 回答
1647 浏览

docker - 如何在 debian docker 容器中安装根 CA 证书以与 kestrel HTTPS 一起使用

我坚持让 https 客户端身份验证与在 Debian 的 docker 容器中运行的 Asp.Net Core 应用程序一起工作。Asp.Net 应用程序在 Windows 上运行良好,客户端通过证书进行身份验证。

但是,如果我在 docker 容器中运行 asp.net 应用程序,一些客户端将不会发送任何客户端证书,因为在 SSL 握手中服务器会发送他所有受信任的根 CA 的列表。然后一些基于 .Net 4.0 的客户端过滤他们的客户端证书,因此它只包含由该列表中的 CA 颁发的证书。

现在我的问题是我没有安装 docker Debian 系统的根 CA,所以我的根 CA 在服务器发送的列表中。

我已经尝试过在我的 dockerfile 中添加证书

但这似乎不起作用。

另一种选择是告诉服务器不要发送证书信任列表,但我找不到解决方案。

Asp.NET Core 应用程序使用“Microsoft/aspnetcore:2.0” docker 映像运行。

0 投票
1 回答
55 浏览

azure - Azure 中托管的 ASP .net Core 缺少洞察数据

我们在 Azure 中托管了一个 ASP .NET Core Web api。请求和遥测数据记录得很好,但没有跟踪内存和 CPU 的性能计数器。

我认为这是因为该应用程序未在 IIS 上运行,但我有点不确定它是如何在这里工作的,有人可以帮我提供一些信息,我会很感激!

0 投票
0 回答
810 浏览

.net - 指定的参数超出了有效值的范围。参数名称:计数

我用 asp.net core 2.0 编写了一个站点,有时会出现错误引发(很少)。

发生了未处理的异常:指定的参数超出了有效值的范围。参数名称:计数

堆栈跟踪:

System.ArgumentOutOfRangeException:指定的参数超出了有效值的范围。参数名称:Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.Pipe.GetResult(ReadResult& result) 处的 Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.PipeCompletion.ThrowFailed() 处的计数在 Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.Pipe.Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.IReadableBufferAwaiter.GetResult() 在 Microsoft.AspNetCore.Server.Kestrel.Internal Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.MessageBody.d__24.MoveNext() 处的 .System.IO.Pipelines.ReadableBufferAwaitable.GetResult() --- 堆栈跟踪从上一个引发异常的位置结束--- - 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo。1.<ProcessRequestsAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame1.d__2.MoveNext()

我不确定,但这个错误可能是在我迁移到 asp.net core 2.0 之后。

0 投票
1 回答
5730 浏览

asp.net-mvc - HttpContext.RequestAborted 和 CancellationToken 参数有什么区别?

我正在尝试为ASP.NET Core 2.0创建一个异步视图组件。当用户离开页面时,它将执行应取消的操作。我有以下选择:

  1. 使用 HttpContext.RequestAborted
  2. 使用 CancellationToken 参数
  3. 我也可以链接令牌

选项 1 如下所示:

选项 2 如下所示:

这两个操作都不适用于 Kestrel(看起来像一个错误)。在这两种情况下,令牌都被填充(可能是因为结构?)

有什么区别,我应该使用什么?

0 投票
1 回答
1661 浏览

c# - 在单个 Kestrel 服务器实例上运行多个 ASP.net 核心 Web api 应用程序

是否可以在同一台机器上运行多个 asp.net core web api 应用程序并监听不同的端口,并且所有服务都应该在同一个 kestrel 实例上运行?

我需要使用 ASP.net 核心 web api 开发多个服务(微服务),并且应该部署在同一台机器上,并且应该使用 HTTPS 和相同的 SSL 证书。根据我的发现,每个服务都需要配置为在单独的 kestrel 实例上运行,因此为每个服务配置相同的 SSL 事物会产生开销。我正在尝试找到一种在单个红隼实例上运行所有服务的方法,以便我可以一次性启用 SSL。

0 投票
2 回答
2663 浏览

c# - Kestrel 中的 app.UseDefaultFiles 什么都不做?

我在一个小型项目的 Startup.cs 文件中有这个文件,该文件用于使用 Kestrel 托管静态文件的网络服务器:

但是,它不会尝试加载 index.html 或任何内容。如果我手动访问它,它确实有效。

有任何想法吗?

谢谢

0 投票
0 回答
354 浏览

asp.net - Inital request to ASP.NET Core app API take longer

I have an ASP.NET Core app hosted behind Nginx on a good fast SSD server and database is MySql hosted on the same server. I am experiencing very weird behaviour.

Here are some examples. So the number represents a call to the API and then there is a response time. I thought I have some inside architecture problem so I have a date time object in the beginning of the controller and in the end where and then I measure the timespan, something like this:

So here is what I get (app is on server I am calling from local machine which is on a fast 100mbps network):

calls made straight after deployment api adress 1

1) 4.879 sec 2) 262 ms 3) 10ms 4) 14ms 5) 7ms 6) 7 ms 7) 8 ms

api adres 2 8) 523ms 9) 16ms 10) 6ms 11) 7ms 12) 5ms

As we can see the initial call to the first API takes the longest time and then the time decreases to a minimum of 7ms. If I switch to another API enpoint I get almost the same on start however it is a bit faster but the afterwords behavoiur is exactly the same except for it stabilizes to around 10ms response time much quicker.

Has anyone ever experinced this matter? I heard possible workarounds as to make initial call before user does but I suspect this behavoiur will return maybe after some timeout and this does sound a but ugly? How can I see what is actually happening behind the curtains?

Really stuck with this issue, app works quite well but this is just a real pain. Thanks in advance! Would really appreciate any helpfull info on this.


UPDATE So I have investigated into system logs on my Linux machine and here is what I get.

0 投票
2 回答
1517 浏览

iis - .Net Core SSL 文件 找不到此页面 未找到该网址的网页:

我正在尝试将 SSL 集成到我的 asp.net 核心项目我下载 sslforfree 文件以进行手动验证。我将验证文件上传到我的服务器

尽管路径中的服务器中有文件,但在浏览器中浏览我的网站时会出现该错误

找不到此页面 没有找到该网址的网页:

这是链接。

我的 .net 核心网站工作。只是它不显示验证文件

这是我的服务器路径文件

在此处输入图像描述

在 IIS 服务器中,我将 mime 类型 .(comma) 作为文本/纯文本,但它仍然给出错误。我该怎么办?这适用于具有 4.0 应用程序池的 .net mvc 项目,但在 asp.net 核心应用程序中找不到页面错误水池

这是我的startup.cs

0 投票
1 回答
404 浏览

.net-core - 如何从自定义 Web 应用程序目录运行 .NET Core API 应用程序,而不仅仅是根目录?

我有一个 .NET Core 2.0 MVC 和 API 应用程序。该应用程序可从 Web 根目录访问,例如 localhost:51672/, localhost:51672/Home, localhost:51672/api/.... 我希望有一个从不同的 Web 应用程序目录运行的选项,例如 localhost: 51672/custom, localhost:51672/custom/Home, localhost:51672/custom/api/...

我假设 Kestrel 中有一些选项或调用 dotnet run 时,但无法找到它。宁愿不必修改代码中的多个位置以使其工作,更喜欢可配置或运行时选项,而不是必须在代码中的多个位置硬连线自定义根路径。

下面使用“自定义”根,除了招摇

对于 web api,能够使用 Contoller 上的 Route 属性使其工作,但实际上不必在所有控制器中指定根路径。在开发中,在自定义 Web 应用程序目录中的生产环境中使用“/”。