Per #64541, it should emit <autogenerated> into the source and also [GeneratedCodeAttribute...] for the IL.
Our other generators do this; this enables tooling and servicing scenarios.
eg regex generator
|
private static readonly string s_generatedCodeAttribute = $"[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"{typeof(RegexGenerator).Assembly.GetName().Name}\", \"{typeof(RegexGenerator).Assembly.GetName().Version}\")]"; |
|
/// <summary>Header comments and usings to include at the top of every generated file.</summary> |
|
private static readonly string[] s_headers = new string[] |
|
{ |
|
"// <auto-generated/>", |
Per #64541, it should emit
<autogenerated>into the source and also[GeneratedCodeAttribute...]for the IL.Our other generators do this; this enables tooling and servicing scenarios.
eg regex generator
runtime/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cs
Lines 27 to 31 in 9df2832