-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed as not planned
Closed as not planned
Copy link
Labels
NativeAOTarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-kestrel
Milestone
Description
I have tried to compile my .NET 5 bare http server project with Native AOT without reflection. This is possible for a normal http connection, but not for a https connection because in Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions the line of code:
var loggerFactory = listenOptions.KestrelServerOptions?.ApplicationServices.GetRequiredService<ILoggerFactory>() ?? NullLoggerFactory.Instance;
that appears twice in this class requires reflection. Could it be changed to:
var loggerFactory = listenOptions.KestrelServerOptions?.ApplicationServices?.GetRequiredService<ILoggerFactory>() ?? NullLoggerFactory.Instance;
so that it has the ? after ApplicationServices. In this way I believe the reflection can be avoided.
nietras and nxrighthereNVentimiglia and mrzaxaryankant2002 and NVentimigliapaulomorgado
Metadata
Metadata
Assignees
Labels
NativeAOTarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-kestrel