Skip to content

TypeLoadExceptions on .NET 9 when referencing HttpSys on Linux #59166

Open
@MihaZupan

Description

@MihaZupan

YARP will try to grab the IServerDelegationFeature on startup to detect if the functionality is supported.
_serverDelegationFeature = server.Features?.Get<IServerDelegationFeature>();

We're seeing many users run into TypeLoadExceptions when upgrading their app from .NET 8 to 9:
dotnet/yarp#2652

System.TypeLoadException: Could not load type 'Microsoft.AspNetCore.Server.HttpSys.IServerDelegationFeature' from assembly 'Microsoft.AspNetCore.Server.HttpSys, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
   at Yarp.ReverseProxy.Delegation.HttpSysDelegator..ctor(IServer server, ILogger`1 logger)

Reports mention both Ubuntu 22 and 24.
I was not able to reproduce the issue myself (on a VM nor WSL).

Possibly a recent regression since RC2?
dotnet/yarp#2652 (comment)

To give some extra confusion, we've been running our test envoirment on 9RC1 and 9RC2 when they came out, and didn't have the issue, they only came with the official release (I use ./dotnet-install.sh, no apt since it wasn't released there yet).


What sort of information would be needed to help diagnose this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions