Skip to content

RegexGenerator does not work in Razor files #59780

@NTaylorMullen

Description

@NTaylorMullen

Version Used: 17.2-Preview1

Steps to Reproduce:

  1. Create a Blazor project
  2. Open Index.Razor
  3. Replace its content with
@using System.Text.RegularExpressions

@code {
    [RegexGenerator("[0-9]")] private static partial Regex someRegex();
}
  1. Build the project

Expected Behavior:
No compile error

Actual Behavior:
Compile error:
image

Additional Notes:
I'm assuming this is due to SourceGenerators not being able to reliable consume outputs from other SourceGenerators

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions