Skip to content

Trimming warning is misleading #49363

@richlander

Description

@richlander

I see this warning when attempting to trim an ASP.NET Core app.

/Users/rich/git/dotnet-docker/samples/aspnetapp/aspnetapp/Program.cs(6,1): warning IL2026: Using member 'Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddRazorPages(IServiceCollection)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Razor Pages does not currently support native AOT. https://aka.ms/aspnet/nativeaot [/Users/rich/git/dotnet-docker/samples/aspnetapp/aspnetapp/aspnetapp.csproj]

I find it confusing. It would be more helpful to me if the following subset said this:

... can break functionality when trimming application code. Razor Pages does not currently support trimming or native AOT. Learn more: https://aka.ms/aspnet/trimming

Metadata

Metadata

Assignees

No one assigned

    Labels

    NativeAOTarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesuntriaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions