Skip to content

Remove FriendAccessAllowedAttribute usage #6561

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

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

ThomasGoulet73
Copy link
Contributor

@ThomasGoulet73 ThomasGoulet73 commented May 9, 2022

Description

Remove FriendAccessAllowedAttribute usage since it is not enforced in .Net Core. FriendAccessAllowedAttribute is an undocumented and non-public attribute which is not supported anymore. To use FriendAccessAllowedAttribute, when supported, you need to set InternalsVisibleToAttribute.AllInternalsVisible to false, which is never set in this repo.

There are modifications to generated files in src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Generated but these files are generated from Elements.cs which is not runnable in this repo right now (#6135) but it should be fine because once we can run MilCodeGen, there shouldn't be any diffs.

Customer Impact

None.

Regression

No.

Testing

Local build + CI.

Risk

Low.

Microsoft Reviewers: Open in CodeFlow

@ThomasGoulet73 ThomasGoulet73 requested a review from a team as a code owner May 9, 2022 23:37
@ghost ghost assigned ThomasGoulet73 May 9, 2022
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label May 9, 2022
@ghost ghost requested review from dipeshmsft, singhashish-wpf and SamBent May 9, 2022 23:37
@ghost ghost added the Community Contribution A label for all community Contributions label May 9, 2022
@ThomasGoulet73 ThomasGoulet73 force-pushed the remove-friendaccessallowed branch from 0050fd8 to 81f5414 Compare June 29, 2022 22:51
@dipeshmsft dipeshmsft self-assigned this Jan 19, 2023
@ThomasGoulet73 ThomasGoulet73 force-pushed the remove-friendaccessallowed branch from 112f7b1 to dcf536e Compare September 30, 2023 02:45
@ThomasGoulet73
Copy link
Contributor Author

I rebased to fix the conflicts.

@pchaurasia14
Copy link
Member

Thanks @ThomasGoulet73! We'll consider this PR for our upcoming CTPs.

@ThomasGoulet73 ThomasGoulet73 force-pushed the remove-friendaccessallowed branch from dcf536e to 1971677 Compare May 1, 2024 01:42
@ThomasGoulet73
Copy link
Contributor Author

I rebased to fix the conflicts.

@lindexi
Copy link
Member

lindexi commented Sep 3, 2024

I rebased to fix the conflicts.

Now, this branch has conflicts

@ThomasGoulet73 ThomasGoulet73 force-pushed the remove-friendaccessallowed branch from 1971677 to 4228c81 Compare September 7, 2024 04:15
@ThomasGoulet73 ThomasGoulet73 requested a review from a team as a code owner September 7, 2024 04:15
@ThomasGoulet73
Copy link
Contributor Author

I rebased to fix the conflicts.

Thanks for the ping @lindexi.

@JeremyKuhne
Copy link
Member

dotnet/runtime#10707 has some more details on this attribute.

Copy link
Member

@JeremyKuhne JeremyKuhne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pchaurasia14 This would be good to get in.

JeremyKuhne added a commit to JeremyKuhne/wpf that referenced this pull request Oct 3, 2024
These are CAS holdovers from .NET Framework that add unnecessary complexity.

Uses more modern / safer syntax where I've modified code. I've also removed a few asserts where they then fall over on the next line anyway.

Similar to and should follow dotnet#7161 and dotnet#6561
@h3xds1nz
Copy link
Member

h3xds1nz commented Oct 4, 2024

Awesome! Those replacements from Thomas will clear out so much clutter.

dipeshmsft added a commit that referenced this pull request Oct 4, 2024
These are CAS holdovers from .NET Framework that add unnecessary complexity.

Uses more modern / safer syntax where I've modified code. I've also removed a few asserts where they then fall over on the next line anyway.

Similar to and should follow #7161 and #6561
@dipeshmsft dipeshmsft merged commit 56b7b4f into dotnet:main Oct 4, 2024
8 checks passed
@ThomasGoulet73 ThomasGoulet73 deleted the remove-friendaccessallowed branch October 4, 2024 19:19
JeremyKuhne added a commit to JeremyKuhne/wpf that referenced this pull request Oct 4, 2024
These are CAS holdovers from .NET Framework that add unnecessary complexity.

Uses more modern / safer syntax where I've modified code. I've also removed a few asserts where they then fall over on the next line anyway.

Similar to and should follow dotnet#7161 and dotnet#6561
dipeshmsft pushed a commit that referenced this pull request Oct 7, 2024
* Remove SecurityCriticalData/Class

These are CAS holdovers from .NET Framework that add unnecessary complexity.

Uses more modern / safer syntax where I've modified code. I've also removed a few asserts where they then fall over on the next line anyway.

Similar to and should follow #7161 and #6561

* Address feedback
@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants