Skip to content

Interop source generator should insert [GeneratedCodeAttribute] #64562

@danmoseley

Description

@danmoseley

As noted in #64541,

  • this makes it consistent with our other generators
  • metadata tools cannot see <autogenerated>, which is hte preferred source marking
  • there are scenarios where one might scan assemblies to see whether it is necessary to regenerate with a bug-fixed generator

example, from the regex generator

private static readonly string s_generatedCodeAttribute = $"[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"{typeof(RegexGenerator).Assembly.GetName().Name}\", \"{typeof(RegexGenerator).Assembly.GetName().Version}\")]";

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions