Skip to content

CS9270 'InterceptsLocationAttribute(string, int, int)' is not supported when using net8.0 Request Delegate Generator #59735

Closed as not planned
@eerhardt

Description

@eerhardt

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When using the latest C# / Visual Studio main builds with a net8.0 minimal API project with <EnableRequestDelegateGenerator>true</EnableRequestDelegateGenerator>, you now get a warning:

Severity	Code	Description	Project	File	Line	Suppression State	Details
Warning (active)	CS9270	'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (https://github.com/dotnet/roslyn/issues/72133)	WebApplication6	D:\source\WebApplication6\WebApplication6\obj\Debug\net8.0\Microsoft.AspNetCore.Http.RequestDelegateGenerator\Microsoft.AspNetCore.Http.RequestDelegateGenerator.RequestDelegateGenerator\GeneratedRouteBuilderExtensions.g.cs	61		

See dotnet/roslyn#76641 for more discussion.

Expected Behavior

There shouldn't be any warnings by default.

Steps To Reproduce

  1. Install the latest C# or Visual Studio from main. I have C# Tools 4.13.0-3.24620.4+98ea496177bc8e607dbf454abd6b5a5e4678aed2
  2. Create a new "ASP.NET Core Web API" project. Be sure to select ".NET 8.0 (LongTerm Support)"
  3. Modify the .csproj with <EnableRequestDelegateGenerator>true</EnableRequestDelegateGenerator>
  4. Build

Note: You can get the same with creating a new "ASP.NET Core Web API (native AOT)" project.

Exceptions (if any)

No response

.NET Version

No response

Anything else?

cc @captainsafia @mikekistler

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-rdg

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions