-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[API Compat] CP0015 false positive for GeneratedCodeAttribute/GeneratedRegexAttribute #45954
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
1 similar comment
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
cc @ViktorHofer |
@ericstj any idea? |
We get a similar error for all public WPF XAML User Controls:
The C# code generated by the WPF targets looks like this (decompiled with dotPeek): /// <summary>InitializeComponent</summary>
[DebuggerNonUserCode]
[GeneratedCode("PresentationBuildTasks", "8.0.8.0")]
public void InitializeComponent()
{
if (this._contentLoaded)
return;
this._contentLoaded = true;
Application.LoadComponent((object) this, new Uri("/MyLib.UI;component/systemdiagnosis/materials/myview.xaml", UriKind.Relative));
} |
Probably folks should just suppress the The attribute rule is very noisy by default, it assumes rigid compatibility for attributes since every attribute has different rules about what's compatible and we haven't encoded that. Ultimately #35542 would allow for per-attribute handling of attributes - and for |
@ericstj I understand that |
@dotnet/area-infrastructure-libraries a new issue has been filed in the ApiCompat area, please triage |
I couldn't reproduce this with the code snippet you shared, do you have a repro that demonstrates it? FWIW - I think it's totally normal for folks to see a real difference here that should be ignored. Nearly every month we ship a new targeting pack with a new build of the source generators which will change the value here. That shouldn't be a breaking change. Here's the relevant portion of APICompat that handles this: Lines 19 to 38 in 9c5e62d
And here's it "working correctly" under the debugger for the sample shared: |
When I run the baseline package validation on a library that contains the following C# code that was not changed between the two versions
I get the following error that I think shouldn't be getting:
When I look at the IL using ILDASM, I see no differences in the
GeneratedCodeAttribute
Decompiled IL in MyLib.dll Version 1.1.0:
Decompiled IL in MyLib.dll Version 1.2.0:
The text was updated successfully, but these errors were encountered: