Skip to content

Commit 86c46c0

Browse files
mitchdennyeerhardt
andauthored
Tweak messages on trimming warnings. (#49377)
* Tweak unreferenced code warnings to include both trimming and native AOT --------- Co-authored-by: Eric Erhardt <[email protected]>
1 parent 6eedb18 commit 86c46c0

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

src/Components/Endpoints/src/DependencyInjection/RazorComponentsServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static class RazorComponentsServiceCollectionExtensions
2828
/// </summary>
2929
/// <param name="services">The service collection.</param>
3030
/// <returns>An <see cref="IRazorComponentsBuilder"/> that can be used to further configure the Razor component services.</returns>
31-
[RequiresUnreferencedCode("Razor Components does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
31+
[RequiresUnreferencedCode("Razor Components does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
3232
public static IRazorComponentsBuilder AddRazorComponents(this IServiceCollection services)
3333
{
3434
ArgumentNullException.ThrowIfNull(services);

src/Components/Server/src/DependencyInjection/ComponentServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static class ComponentServiceCollectionExtensions
2929
/// <param name="services">The <see cref="IServiceCollection"/>.</param>
3030
/// <param name="configure">A callback to configure <see cref="CircuitOptions"/>.</param>
3131
/// <returns>An <see cref="IServerSideBlazorBuilder"/> that can be used to further customize the configuration.</returns>
32-
[RequiresUnreferencedCode("Server-side Blazor does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
32+
[RequiresUnreferencedCode("Server-side Blazor does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
3333
public static IServerSideBlazorBuilder AddServerSideBlazor(this IServiceCollection services, Action<CircuitOptions>? configure = null)
3434
{
3535
var builder = new DefaultServerSideBlazorBuilder(services);

src/Identity/Core/src/IdentityServiceCollectionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static class IdentityServiceCollectionExtensions
2727
/// <typeparam name="TRole">The type representing a Role in the system.</typeparam>
2828
/// <param name="services">The services available in the application.</param>
2929
/// <returns>An <see cref="IdentityBuilder"/> for creating and configuring the identity system.</returns>
30-
[RequiresUnreferencedCode("Identity middleware does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
30+
[RequiresUnreferencedCode("Identity middleware does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
3131
public static IdentityBuilder AddIdentity<TUser, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TRole>(
3232
this IServiceCollection services)
3333
where TUser : class
@@ -42,7 +42,7 @@ public static class IdentityServiceCollectionExtensions
4242
/// <param name="services">The services available in the application.</param>
4343
/// <param name="setupAction">An action to configure the <see cref="IdentityOptions"/>.</param>
4444
/// <returns>An <see cref="IdentityBuilder"/> for creating and configuring the identity system.</returns>
45-
[RequiresUnreferencedCode("Identity middleware does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
45+
[RequiresUnreferencedCode("Identity middleware does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
4646
public static IdentityBuilder AddIdentity<TUser, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TRole>(
4747
this IServiceCollection services,
4848
Action<IdentityOptions> setupAction)

src/Middleware/Session/src/SessionServiceCollectionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static class SessionServiceCollectionExtensions
1818
/// </summary>
1919
/// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param>
2020
/// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
21-
[RequiresUnreferencedCode("Session State middleware does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
21+
[RequiresUnreferencedCode("Session State middleware does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
2222
public static IServiceCollection AddSession(this IServiceCollection services)
2323
{
2424
ArgumentNullException.ThrowIfNull(services);
@@ -34,7 +34,7 @@ public static IServiceCollection AddSession(this IServiceCollection services)
3434
/// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param>
3535
/// <param name="configure">The session options to configure the middleware with.</param>
3636
/// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
37-
[RequiresUnreferencedCode("Session State middleware does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
37+
[RequiresUnreferencedCode("Session State middleware does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
3838
public static IServiceCollection AddSession(this IServiceCollection services, Action<SessionOptions> configure)
3939
{
4040
ArgumentNullException.ThrowIfNull(services);

src/Mvc/Mvc.RazorPages/src/DependencyInjection/MvcRazorPagesMvcCoreBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static class MvcRazorPagesMvcCoreBuilderExtensions
2727
/// </summary>
2828
/// <param name="builder">The <see cref="IMvcCoreBuilder"/>.</param>
2929
/// <returns>The <see cref="IMvcCoreBuilder"/>.</returns>
30-
[RequiresUnreferencedCode("Razor Pages does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
30+
[RequiresUnreferencedCode("Razor Pages does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
3131
public static IMvcCoreBuilder AddRazorPages(this IMvcCoreBuilder builder)
3232
{
3333
ArgumentNullException.ThrowIfNull(builder);

src/Mvc/Mvc/src/MvcServiceCollectionExtensions.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static class MvcServiceCollectionExtensions
2727
/// </summary>
2828
/// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
2929
/// <returns>An <see cref="IMvcBuilder"/> that can be used to further configure the MVC services.</returns>
30-
[RequiresUnreferencedCode("MVC does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
30+
[RequiresUnreferencedCode("MVC does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
3131
public static IMvcBuilder AddMvc(this IServiceCollection services)
3232
{
3333
ArgumentNullException.ThrowIfNull(services);
@@ -42,7 +42,7 @@ public static IMvcBuilder AddMvc(this IServiceCollection services)
4242
/// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
4343
/// <param name="setupAction">An <see cref="Action{MvcOptions}"/> to configure the provided <see cref="MvcOptions"/>.</param>
4444
/// <returns>An <see cref="IMvcBuilder"/> that can be used to further configure the MVC services.</returns>
45-
[RequiresUnreferencedCode("MVC does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
45+
[RequiresUnreferencedCode("MVC does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
4646
public static IMvcBuilder AddMvc(this IServiceCollection services, Action<MvcOptions> setupAction)
4747
{
4848
ArgumentNullException.ThrowIfNull(services);
@@ -79,7 +79,7 @@ public static IMvcBuilder AddMvc(this IServiceCollection services, Action<MvcOpt
7979
/// on the resulting builder.
8080
/// </para>
8181
/// </remarks>
82-
[RequiresUnreferencedCode("MVC does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
82+
[RequiresUnreferencedCode("MVC does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
8383
public static IMvcBuilder AddControllers(this IServiceCollection services)
8484
{
8585
ArgumentNullException.ThrowIfNull(services);
@@ -114,7 +114,7 @@ public static IMvcBuilder AddControllers(this IServiceCollection services)
114114
/// on the resulting builder.
115115
/// </para>
116116
/// </remarks>
117-
[RequiresUnreferencedCode("MVC does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
117+
[RequiresUnreferencedCode("MVC does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
118118
public static IMvcBuilder AddControllers(this IServiceCollection services, Action<MvcOptions>? configure)
119119
{
120120
ArgumentNullException.ThrowIfNull(services);
@@ -172,7 +172,7 @@ private static IMvcCoreBuilder AddControllersCore(IServiceCollection services)
172172
/// To add services for pages call <see cref="AddRazorPages(IServiceCollection)"/>.
173173
/// </para>
174174
/// </remarks>
175-
[RequiresUnreferencedCode("MVC does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
175+
[RequiresUnreferencedCode("MVC does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
176176
public static IMvcBuilder AddControllersWithViews(this IServiceCollection services)
177177
{
178178
ArgumentNullException.ThrowIfNull(services);
@@ -205,7 +205,7 @@ public static IMvcBuilder AddControllersWithViews(this IServiceCollection servic
205205
/// To add services for pages call <see cref="AddRazorPages(IServiceCollection)"/>.
206206
/// </para>
207207
/// </remarks>
208-
[RequiresUnreferencedCode("MVC does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
208+
[RequiresUnreferencedCode("MVC does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
209209
public static IMvcBuilder AddControllersWithViews(this IServiceCollection services, Action<MvcOptions>? configure)
210210
{
211211
ArgumentNullException.ThrowIfNull(services);
@@ -253,7 +253,7 @@ private static IMvcCoreBuilder AddControllersWithViewsCore(IServiceCollection se
253253
/// To add services for controllers with views call <see cref="AddControllersWithViews(IServiceCollection)"/>.
254254
/// </para>
255255
/// </remarks>
256-
[RequiresUnreferencedCode("Razor Pages does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
256+
[RequiresUnreferencedCode("Razor Pages does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
257257
public static IMvcBuilder AddRazorPages(this IServiceCollection services)
258258
{
259259
ArgumentNullException.ThrowIfNull(services);
@@ -284,7 +284,7 @@ public static IMvcBuilder AddRazorPages(this IServiceCollection services)
284284
/// To add services for controllers with views call <see cref="AddControllersWithViews(IServiceCollection)"/>.
285285
/// </para>
286286
/// </remarks>
287-
[RequiresUnreferencedCode("Razor Pages does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
287+
[RequiresUnreferencedCode("Razor Pages does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
288288
public static IMvcBuilder AddRazorPages(this IServiceCollection services, Action<RazorPagesOptions>? configure)
289289
{
290290
ArgumentNullException.ThrowIfNull(services);

src/SignalR/server/SignalR/src/SignalRDependencyInjectionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static ISignalRServerBuilder AddHubOptions<THub>(this ISignalRServerBuild
3535
/// </summary>
3636
/// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
3737
/// <returns>An <see cref="ISignalRServerBuilder"/> that can be used to further configure the SignalR services.</returns>
38-
[RequiresUnreferencedCode("SignalR does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
38+
[RequiresUnreferencedCode("SignalR does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
3939
public static ISignalRServerBuilder AddSignalR(this IServiceCollection services)
4040
{
4141
ArgumentNullException.ThrowIfNull(services);
@@ -55,7 +55,7 @@ public static ISignalRServerBuilder AddSignalR(this IServiceCollection services)
5555
/// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
5656
/// <param name="configure">An <see cref="Action{HubOptions}"/> to configure the provided <see cref="HubOptions"/>.</param>
5757
/// <returns>An <see cref="ISignalRServerBuilder"/> that can be used to further configure the SignalR services.</returns>
58-
[RequiresUnreferencedCode("SignalR does not currently support native AOT.", Url = "https://aka.ms/aspnet/nativeaot")]
58+
[RequiresUnreferencedCode("SignalR does not currently support trimming or native AOT.", Url = "https://aka.ms/aspnet/trimming")]
5959
public static ISignalRServerBuilder AddSignalR(this IServiceCollection services, Action<HubOptions> configure)
6060
{
6161
ArgumentNullException.ThrowIfNull(services);

0 commit comments

Comments
 (0)