Skip to content

Commit fca8088

Browse files
authored
Add RequiresUnreferencedCode attribute to AddMvc calls. (#47816)
1 parent 1c63bf6 commit fca8088

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Mvc/Mvc/src/MvcServiceCollectionExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +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")]
3031
public static IMvcBuilder AddMvc(this IServiceCollection services)
3132
{
3233
ArgumentNullException.ThrowIfNull(services);
@@ -41,6 +42,7 @@ public static IMvcBuilder AddMvc(this IServiceCollection services)
4142
/// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
4243
/// <param name="setupAction">An <see cref="Action{MvcOptions}"/> to configure the provided <see cref="MvcOptions"/>.</param>
4344
/// <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")]
4446
public static IMvcBuilder AddMvc(this IServiceCollection services, Action<MvcOptions> setupAction)
4547
{
4648
ArgumentNullException.ThrowIfNull(services);

0 commit comments

Comments
 (0)