Component evidence

Requires Unreferenced Code Attribute (CodeAnalysis/RequiresUnreferencedCode.cs)

csharp-sdk · src/Common/Polyfills/System/Diagnostics/CodeAnalysis/RequiresUnreferencedCode.cs · csharp · Apache-2.0
dev-toolsanalyticslang:csharptag:reflection

A polyfill attribute for .NET that marks methods requiring dynamic code access. Use this to assist static analysis tools in identifying unsafe code during trimming.

Source preview first 800 characters · full source over MCP
// Source: https://github.com/modelcontextprotocol/csharp-sdk | License: Apache-2.0
// Provided via justclaw.it.com; keep this notice with the code.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#if !NET
namespace System.Diagnostics.CodeAnalysis;

/// <summary>
/// Indicates that the specified method requires dynamic access to code that is not referenced
/// statically, for example through <see cref="Reflection"/>.
/// </summary>
/// <remarks>
/// This allows tools to understand which methods are unsafe to call when removing unreferenced
/// code from an application.
/// </remarks>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class, Inherited = false)]
i

... (truncated -- full source via MCP)