Skip to content

Added CAS changes to WPF migration doc #13879

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 3 commits into from
Aug 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion docs/desktop/wpf/migration/differences-from-net-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,42 @@ ms.author: adegeo

# Do something

First paragraph
First paragraph


**Code Access Security (CAS)**

WPF no longer supports Code Access Security (CAS) which is in accordance with .NET Core. This means that all CAS related functionality will now be treated as a no-op and everything operated under the assumption of full trust. Due to this, WPF has been moving to remove CAS related code. We hollowed out and moved publicly defined CAS related types out of WPF assemblies into CoreFX assemblies. The original WPF assemblies now have type forwarding to the new location of the moved types.

The following list of types were hollowed out and moved from `WindowsBase.dll` to `System.Security.Permissions.dll`

- MediaPermission
- MediaPermissionAttribute
- MediaPermissionAudio
- MediaPermissionImage
- MediaPermissionVideo
- WebBrowserPermission
- WebBrowserPermissionAttribute
- WebBrowserPermissionLevel


The following type was hollowed out and moved from `System.Xaml.dll` to `System.Security.Permissions.dll`
- XamlLoadPermission

The following type was hollowed out moved from `System.Xaml.dll` to `System.Windows.Extension.dll`.
- XamlAccessLevel

**Note:** In order to minimize porting friction, the functionality for storing and retrieving information related to the following properties were retained in the `XamlAccessLevel` type.
- public string PrivateAccessToTypeName
- internal string AssemblyNameString

For more information here is the location of the moved type: https://github.com/dotnet/corefx/blob/master/src/System.Windows.Extensions/src/System/Xaml/Permissions/XamlAccessLevel.cs


You can diff the two files below for an example of how the `MediaPermission` type has changed after hollowing out.

**Before:**
https://github.com/dotnet/wpf/blob/56ccaad970cefa576396e2aba8e19fa88d9b5f51/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Security/Permissions/MediaPermission.cs

**After:**
https://github.com/dotnet/corefx/blob/df5bb8e4509ca5166f83abbd4cfe4a063433fee7/src/System.Security.Permissions/src/System/Security/Permissions/MediaPermission.cs