Skip to content

Source generator should ensure hint names are unique #11578

Open
@jjonescz

Description

@jjonescz

Version used: .NET v9.0.200

Steps to reproduce:

  1. Create file Components/Counter.razor.
  2. Create file Components_Counter.razor.
  3. Compile.

Actual Result:

CSC : warning CS8785: Generator 'RazorSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'Components_Counter_razor.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName')'.

Expected Result:

Either

  • a better error message, or
  • success.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions