dotnet/yarp · critical · NotSupportedException

{typeof(IHttpSysRequestDelegationFeature).FullName} is not a

Error message

{typeof(IHttpSysRequestDelegationFeature).FullName} is not available. Http.sys delegation is only supported when using the Http.sys server

What it means

Thrown by UseHttpSysDelegation extension when the IServerDelegationFeature is not present on the server's features. Http.sys request delegation only works with the ASP.NET Core Http.sys server; the feature is not registered by Kestrel or other servers. The extension probes for the feature at app-build time to fail fast rather than at first delegated request.

Source

Thrown at src/ReverseProxy/Delegation/AppBuilderDelegationExtensions.cs:29

/// <summary>
/// Extensions for adding delegation middleware to the pipeline.
/// </summary>
public static class AppBuilderDelegationExtensions
{
    /// <summary>
    /// Adds middleware to check if the selected destination should use Http.sys delegation.
    /// If so, the request is delegated to the destination queue instead of being proxied over HTTP.
    /// This should be placed after load balancing and passive health checks.
    /// </summary>
    /// <remarks>
    /// This middleware only works with the ASP.NET Core Http.sys server implementation.
    /// </remarks>
    public static IReverseProxyApplicationBuilder UseHttpSysDelegation(this IReverseProxyApplicationBuilder builder)
    {
        // IServerDelegationFeature isn't added to DI https://github.com/dotnet/aspnetcore/issues/40043
        _ = builder.ApplicationServices.GetRequiredService<IServer>().Features?.Get<IServerDelegationFeature>()
            ?? throw new NotSupportedException($"{typeof(IHttpSysRequestDelegationFeature).FullName} is not available. Http.sys delegation is only supported when using the Http.sys server");

        builder.UseMiddleware<HttpSysDelegatorMiddleware>();
        return builder;
    }
}

View on GitHub (pinned to bd11867bee)

Solutions

  1. Switch the host to Http.sys (UseHttpSys() instead of UseKestrel()) on Windows.
  2. Guard the UseHttpSysDelegation call with an OS/server check so it only applies on Windows with Http.sys.
  3. Remove the delegation middleware if Http.sys delegation is not a deployment requirement.

Example fix

// before — Kestrel + delegation (throws)
builder.WebHost.UseKestrel();
app.MapReverseProxy(p => p.UseHttpSysDelegation());
// after — Http.sys on Windows
builder.WebHost.UseHttpSys();
app.MapReverseProxy(p => p.UseHttpSysDelegation());
Defensive patterns

Strategy: type-guard

Validate before calling

if (!OperatingSystem.IsWindows())
    throw new PlatformNotSupportedException("Http.sys delegation requires Windows.");
var feat = builder.ApplicationServices.GetRequiredService<IServer>().Features?.Get<IServerDelegationFeature>();
if (feat is null) throw new NotSupportedException("Use Http.sys server for delegation.");

Type guard

static bool SupportsHttpSysDelegation(IWebHostBuilder b) =>
    OperatingSystem.IsWindows() &&
    b.Build().Services.GetRequiredService<IServer>().Features.Get<IServerDelegationFeature>() is not null;

Try / catch

try { app.UseHttpSysDelegation(); }
catch (NotSupportedException ex) when (ex.Message.Contains("Http.sys"))
{ logger.LogWarning(ex, "Http.sys delegation disabled; not on Http.sys server."); }

Prevention

When it happens

Trigger: Calling UseHttpSysDelegation(builder) when the app is hosted on Kestrel (or any non-Http.sys server), so IServer.Features.Get<IServerDelegationFeature>() returns null.

Common situations: Developing on Linux/macOS where Http.sys is unavailable (Windows-only). Using Kestrel by default but enabling delegation middleware unconditionally. Copying Windows-only sample code to a cross-platform deployment.

Related errors


AI-assisted analysis of dotnet/yarp@bd11867bee (2026-08-13). Data as JSON: /api/errors/e5028c91245d7077. Report an issue: GitHub.