dotnet / dotnet/dotnet-api-docs

.NET Core samples should not include CAS elements

Open
#837 11 comments 0 reactions 1 assignee Claimed by @tdykstra View on GitHub
area-System.Security doc-bug dotnet-api/prod Pri2
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

In .NET Core, CAS types (like `FileIOPermission`, etc) and Security Transparency types are stubbed only. CAS is not supported. Therefore the samples in .NET Core topics should not include use of them.

For example, in the [AppDomain.UnhandledException topic](https://docs.microsoft.com/en-us/dotnet/api/system.appdomain.unhandledexception?redirectedfrom=MSDN&view=netcore-2.1) for .NET Core 2.1 it has this sample:
```c#
using System;
using System.Security.Permissions;

public class Example
{
[SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.ControlAppDomain)]
public static void Main()
{
...
```
Here `[SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.ControlAppDomain)]` should be removed as it does nothing and implies that CAS is relevant.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 48667829-dc8d-680d-6fde-71a46dee4ce7
* Version Independent ID: 15184777-1251-be89-27a7-7ca859082294
* Content: [AppDomain.UnhandledException Event (System)](https://docs.microsoft.com/en-us/dotnet/api/system.appdomain.unhandledexception?redirectedfrom=MSDN&view=netcore-2.1)
* Content Source: [xml/System/AppDomain.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System/AppDomain.xml)
* Product: **dotnet-api**
* GitHub Login: @rpetrusha
* Microsoft Alias: **ronpet**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.