Skip to content

Generated code should include [GeneratedCodeAttribute] and // <auto-generated/> #64541

@danmoseley

Description

@danmoseley

Logging, Interop, Regex and JSON generators include // <auto-generated/> at the top of their emitted .g.cs.
EventSource generator does not.

Logging, Regex and JSON generators include something like [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Extensions.Logging.Generators", "42.42.42.42")]
EventSource and Interop generators do not.

After #64534, all 5 of them use .g.cs extensions when writing to disk.

@jaredpar is it reasonable that all three of these should be required by convention in generators? I'm not sure what effect each one has. For example, we discovered that coverlet looks for .g.cs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Metasource-generatorIndicates an issue with a source generator feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions