EndpointName metadata not set automatically
Behavior that was introduced in .NET 6 RC 1 to automatically set
IEndpointNameMetadata for endpoints has been reverted.
IEndpointNameMetadata is no longer set automatically to avoid issues with duplicate endpoint names.
ASP.NET Core 6 RC 2
In ASP.NET Core 6 RC 1,
IEndpointNameMetadata was automatically set for endpoints that referenced a method group. For example, the following code produced an endpoint for
EndpointName set to
Starting in ASP.NET Core 6 RC 2,
IEndpointNameMetadata is not automatically set. The following code does not generate any
Type of breaking change
This change can affect source compatibility.
Reason for change
The behavior of automatically setting endpoint name metadata was not robust and resulted in issues where the same name was set for different endpoints. For more information, see dotnet/aspnetcore#36487.
We recommend that you manually set
IEndpointNameMetadata using the
WithName extension method to set the metadata.
Submit and view feedback for