Skip to content

Consider replacing AddRouting with AddRoutingCore in AddConnections #56559

@eerhardt

Description

@eerhardt

In #56460 (comment) we are making SignalR server compatible with native AOT. Investigating the extra 2.2 MB of app size in a SignalR app over the dotnet new webapiaot template, the largest difference that can be trimmed is from cutting System.Text.RegularExpressions out of the app. The reason it gets pulled in is because this calls AddRouting and not AddRoutingCore.

public static IServiceCollection AddConnections(this IServiceCollection services)
{
services.AddRouting();

In the past investigations, Regex adds roughly 750 KB of app size in native AOT (see #46142 and #46227). We added AddRoutingCore for this specific reason.

cc @BrennanConroy

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions