Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interop source generator should insert [GeneratedCodeAttribute] #64562

Closed
danmoseley opened this issue Jan 31, 2022 · 1 comment · Fixed by #65868
Closed

Interop source generator should insert [GeneratedCodeAttribute] #64562

danmoseley opened this issue Jan 31, 2022 · 1 comment · Fixed by #65868

Comments

@danmoseley
Copy link
Member

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}\")]";

@ghost
Copy link

ghost commented Jan 31, 2022

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Issue Details

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}\")]";

Author: danmoseley
Assignees: -
Labels:

area-System.Runtime.InteropServices

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jan 31, 2022
@AaronRobinsonMSFT AaronRobinsonMSFT removed the untriaged New issue has not been triaged by the area owner label Feb 6, 2022
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 7.0.0 milestone Feb 6, 2022
jkoritzinsky added a commit to jkoritzinsky/runtime that referenced this issue Feb 24, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Feb 24, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Mar 2, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants