dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.36k stars 4.74k forks source link

[API Proposal]: Obsolete `Assembly` property `IsFullyTrusted` #107205

Open elinor-fung opened 2 months ago

elinor-fung commented 2 months ago

Background and motivation

In .NET, IsFullyTrusted has no meaning and always returns true.

API Proposal

namespace System.Reflection;

public abstract class Assembly
{
+   [Obsolete("Assembly.IsFullyTrusted has been deprecated and is not supported.", DiagnosticId= /*SYSLIB...*/)]
    public bool IsFullyTrusted { get; }
}

API Usage

var assembly = Assembly.Load(...);
Console.WriteLine(assembly.IsFullyTrusted); // always true

Alternative Designs

No response

Risks

No response

dotnet-policy-service[bot] commented 2 months ago

Tagging subscribers to this area: @dotnet/area-system-reflection See info in area-owners.md if you want to be subscribed.

ThomasGoulet73 commented 2 months ago

Would it make sense to also obsolete the properties IsSecurityTransparent, IsSecuritySafeCritical and IsSecurityCritical on the types MethodBase, FieldInfo and Type ? I believe they also have no meaning in .Net and always return constants.