-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Hollowed out public types extending from System.Security.Permissions types #869
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
Conversation
Your build is passing, but tests are failing (so, well, the build is not passing, really). Do you have a sense for what's going on?
|
src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Permissions/XamlAccessLevel.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Permissions/XamlAccessLevel.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Permissions/XamlLoadPermission.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Permissions/XamlLoadPermission.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Security/Permissions/MediaPermission.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Security/Permissions/WebBrowserPermission.cs
Outdated
Show resolved
Hide resolved
@ericstj , We'd like to move these types to |
Excellent, please open a PR.
What kind of dangling-references? Dangling type-forwards: sure. We do the same for our mscorlib.dll facade. Dangling type-refs from attribute applications / actual usage: no-go : JIT would throw. |
Dangling type-forwards only. The goal is to eliminate all actual type-refs before RTM and end up with ref assemblies that didn't require S.S.Permissions to build (module type-forwards). You'll start seeing a related PR's to get to this shortly (I'll cc you) |
@ojhad, once the changes are made and the test failure is figured out, let's merge the changes into WPF and then move the dummied-out impl. to corefx |
Be aware that we're trying to lock down all API changes in CoreFx by Preview7 which means this would need to make it into corefx in the next couple weeks. For a move like this, I'd recommend adding types in CoreFx, letting them flow upstack, then swap from type-def to typeforward when the packages reach WPF. It does mean that we'll have a couple SDK builds with the types in both places, but that only breaks apps trying to compile against them which we don't expect a lot of folks to need to do. |
src/Microsoft.DotNet.Wpf/src/System.Xaml/System/Xaml/Permissions/XamlAccessLevel.cs
Outdated
Show resolved
Hide resolved
@@ -16,6 +16,10 @@ public sealed class XamlLoadPermission : CodeAccessPermission, IUnrestrictedPerm | |||
public XamlLoadPermission(PermissionState state) { } | |||
public XamlLoadPermission(XamlAccessLevel allowedAccess) { } | |||
public XamlLoadPermission(IEnumerable<XamlAccessLevel> allowedAccess) { } | |||
[ComVisible(false)] | |||
public override bool Equals(object obj) { return false; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a valid implementation because x.Equals(x)
returns false, which will cause all sorts of bugs if anyone calls this method. You should use ReferenceEquals(this, obj)
or throw an exception if you don't want to support equality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This impl. will get deleted from dotnet/wpf shortly, and we'll consume the one from dotnet/corefx#38405. Let's make sure we get the corefx PR right.
Currently this PR does not include Type Forwarding of these types
Part of Issue #241
Hollowing out public types that should be moved out of WPF to System.Security.Permissions.dll