System.argumentnullexception: значение не может быть нулевым. (Параметр
'Provider')
at System.Throwhelper.Throw (String paramname)
at
microsoft.extensions.dependencyInction.serviceProviderServiceExtensions.getRequiredService= > поставщик)
at
microsoft.aspnetcore.hosting.listenoptionshttpsextensions.usehttps(listenoptions
Listenoptions, httpsconnectionAdapteroptions httpsoptions)
at
nanokestrel.c__displayclass16_0.s.ctor> /> Listenoptions) < /p>
< /blockquote>
Код: Выделить всё
public class NanoKestrel
{
public IServer Server { get; set; }
private HostingApplication _application { get; set; }
private X509Certificate2 _serverCertificate { get; set; }
public NanoKestrel(IPEndPoint endPoint, X509Certificate2 certificate = null)
{
_serverCertificate = certificate;
var services = new ServiceCollection();
services.AddLogging(b =>
{
b.AddFilter("Microsoft.AspNetCore.Server.Kestrel", LogLevel.Warning);
});
services.Configure(options =>
{
options.Listen(endPoint, listenOptions =>
{
listenOptions.Protocols = HttpProtocols.Http1AndHttp2AndHttp3;
if (_serverCertificate != null) listenOptions.UseHttps(new HttpsConnectionAdapterOptions() { ServerCertificate = _serverCertificate }); //
Я попытался обслуживать сертификат для Listenoptions.usehttps ();
Я собираюсь включить Quic/http3 на Kestrel, следующее руководство с https://www.meziantou.net/using-http-3- quic-in-dotnet.htm < /p>
Ссылки на пакет: < /p>
microsoft.extensions.features 7.0.2 < /p>
< /blockquote>
FrameworkReference: < /p>
include = "microsoft.aspnetcore.app"
Подробнее здесь: https://stackoverflow.com/questions/751 ... -parameter