System.Runtime.CompilerServices Namespace

System.Runtime.CompilerServices 命名空間 (Namespace) 為使用 Managed 程式碼指定會影響 Common Language Runtime 執行階段行為的中繼資料 (Metadata) 屬性 (Attribute) 的編譯器撰寫者,提供功能。 The System.Runtime.CompilerServices namespace provides functionality for compiler writers who use managed code to specify attributes in metadata that affect the run-time behavior of the common language runtime.

類別

AccessedThroughPropertyAttribute

指定存取屬性化 (Attributed) 欄位的屬性 (Property) 名稱。Specifies the name of the property that accesses the attributed field.

AsyncIteratorStateMachineAttribute

指出某個方法是否為非同步迭代器。Indicates whether a method is an asynchronous iterator.

AsyncMethodBuilderAttribute

指出非同步方法產生器的類型,作為非同步方法的傳回型別時,它應該由語言編譯器用來建置屬性化型別。Indicates the type of the async method builder that should be used by a language compiler to build the attributed type when used as the return type of an async method.

AsyncStateMachineAttribute

表示方法是以 Async 還是以 async 修飾詞標記。Indicates whether a method is marked with either the Async or async modifier.

CallConvCdecl

表示方法應該使用 Cdecl 呼叫慣例。Indicates that a method should use the Cdecl calling convention.

CallConvFastcall

這個呼叫慣例在這個 .NET Framework 版本中不支援。This calling convention is not supported in this version of the .NET Framework.

CallConvStdcall

表示方法應該使用 StdCall 呼叫慣例。Indicates that a method should use the StdCall calling convention.

CallConvThiscall

表示方法應該使用 ThisCall 呼叫慣例。Indicates that a method should use the ThisCall calling convention.

CallerArgumentExpressionAttribute

允許擷取傳遞至方法的運算式。Allows capturing of the expressions passed to a method.

CallerFilePathAttribute

可讓您取得包含呼叫端的原始程式檔完整路徑。Allows you to obtain the full path of the source file that contains the caller. 這是在編譯時的檔案路徑。This is the file path at the time of compile.

CallerLineNumberAttribute

可讓您取得呼叫這個方法之原始程式檔中的行號。Allows you to obtain the line number in the source file at which the method is called.

CallerMemberNameAttribute

可讓您取得方法呼叫端的方法或屬性名稱。Allows you to obtain the method or property name of the caller to the method.

CallSite

動態呼叫站台的基底類別。A dynamic call site base class. 這個型別是做為動態站台目標的參數型別使用。This type is used as a parameter type to the dynamic site targets.

CallSite<T>

動態站台類型。Dynamic site type.

CallSiteBinder

負責在動態呼叫位置上執行動態作業之執行階段繫結的類別。Class responsible for runtime binding of the dynamic operations on the dynamic call site.

CallSiteHelpers

包含 DLR CallSites 之 Helper 方法的類別。Class that contains helper methods for DLR CallSites.

CallSiteOps

建立及快取繫結規則。Creates and caches binding rules.

Closure

表示動態產生之方法的執行階段狀態。Represents the runtime state of a dynamically generated method.

CompilationRelaxationsAttribute

控制由 Common Language Runtime 的 Just-In-Time (JIT) 編譯器所產生之程式碼的嚴格程度。Controls the strictness of the code generated by the common language runtime's just-in-time (JIT) compiler.

CompilerGeneratedAttribute

區別編譯器產生的項目與使用者產生的項目。Distinguishes a compiler-generated element from a user-generated element. 這個類別無法被繼承。This class cannot be inherited.

CompilerGlobalScopeAttribute

指示類別應該視為具有全域範圍。Indicates that a class should be treated as if it has global scope.

CompilerMarshalOverride

表示某個變數的修改執行個體 (Instance) 與封送處理 (Marshaling) 時的真正型別不同。Indicates that the modified instance of a variable differs from its true type when marshaling. 這個類別無法被繼承。This class cannot be inherited.

ConditionalWeakTable<TKey,TValue>

讓編譯器動態地將物件欄位附加至 Managed 物件。Enables compilers to dynamically attach object fields to managed objects.

ContractHelper

提供二進位重寫器用來處理合約失敗的方法。Provides methods that the binary rewriter uses to handle contract failures.

CustomConstantAttribute

定義編譯器可以保存之欄位或方法參數的常數值。Defines a constant value that a compiler can persist for a field or method parameter.

DateTimeConstantAttribute

保存 (Persist) 欄位或參數的 8 位元組 DateTime 常數。Persists an 8-byte DateTime constant for a field or parameter.

DebugInfoGenerator

為運算式樹狀架構中的 Lambda 運算式產生偵錯資訊。Generates debug information for lambda expressions in an expression tree.

DecimalConstantAttribute

Decimal 常數值儲存於中繼資料 (Metadata) 中。Stores the value of a Decimal constant in metadata. 這個類別無法被繼承。This class cannot be inherited.

DefaultDependencyAttribute

提供提示給 Common Language Runtime (CLR),指出載入相依性的可能性。Provides a hint to the common language runtime (CLR) indicating how likely a dependency is to be loaded. 這個類別是用於相依的組件中,表示當父代並未指定 DependencyAttribute 屬性 (Attribute) 時,應該使用哪些提示。This class is used in a dependent assembly to indicate what hint should be used when the parent does not specify the DependencyAttribute attribute. 這個類別無法被繼承。This class cannot be inherited.

DependencyAttribute

表示參考組件載入相依性的時機。Indicates when a dependency is to be loaded by the referring assembly. 這個類別無法被繼承。This class cannot be inherited.

DisablePrivateReflectionAttribute

表示包含在組件類型中的任何私用成員不可用於反映。Indicates that any private members contained in an assembly's types are not available to reflection.

DiscardableAttribute

標記型別定義為可棄置的。Marks a type definition as discardable.

DynamicAttribute

表示成員上 Object 的使用將視為動態分派型別。Indicates that the use of Object on a member is meant to be treated as a dynamically dispatched type.

EnumeratorCancellationAttribute

允許非同步可列舉方法的使用者,針對應該從 GetAsyncEnumerator(CancellationToken) 接收取消語彙基元值的參數進行標記。Allows users of async-enumerable methods to mark the parameter that should receive the cancellation token value from GetAsyncEnumerator(CancellationToken).

ExecutionScope

表示動態產生之方法的執行階段狀態。Represents the runtime state of a dynamically generated method.

ExtensionAttribute

表示方法是擴充方法,或表示類別或組件包含擴充方法。Indicates that a method is an extension method, or that a class or assembly contains extension methods.

FixedAddressValueTypeAttribute

在整個存留期 (Lifetime) 中,固定靜態值型別欄位的位址。Fixes the address of a static value type field throughout its lifetime. 這個類別無法被繼承。This class cannot be inherited.

FixedBufferAttribute

表示欄位應視為包含指定基本類型的固定項目數。Indicates that a field should be treated as containing a fixed number of elements of the specified primitive type. 這個類別無法被繼承。This class cannot be inherited.

FormattableStringFactory

提供靜態方法,從複合格式字串和其引數建立 FormattableString 物件。Provides a static method to create a FormattableString object from a composite format string and its arguments.

HasCopySemanticsAttribute

這個類別不會用於 .NET Framework 2.0 版,而是保留到將來的版本使用。This class is not used in the .NET Framework version 2.0 and is reserved for future use. 這個類別無法被繼承。This class cannot be inherited.

IDispatchConstantAttribute

指示屬性欄位或參數的預設值為 DispatchWrapper 的執行個體,其中 WrappedObjectnullIndicates that the default value for the attributed field or parameter is an instance of DispatchWrapper, where the WrappedObject is null.

IndexerNameAttribute

在不直接支援索引子 (Indexer) 的程式語言中指示可藉以得知索引子的名稱。Indicates the name by which an indexer is known in programming languages that do not support indexers directly.

InternalsVisibleToAttribute

將通常只有在目前組件中可見的類型,指定為指定組件中可見的。Specifies that types that are ordinarily visible only within the current assembly are visible to a specified assembly.

IsBoxed

表示修改的參考型別為 boxed 實值型別。Indicates that the modified reference type is a boxed value type. 這個類別無法被繼承。This class cannot be inherited.

IsByRefLikeAttribute

指出結構類似 ByRef。Indicates that a structure is byref-like.

IsByValue

表示修改的方法引數應該解譯成含有以傳值 (By Value) 方式傳遞物件的語意 (Semantics)。Indicates that a modified method argument should be interpreted as having object passed-by-value semantics. 這個修飾詞會套用至參考型別。This modifier is applied to reference types. 這個類別無法被繼承。This class cannot be inherited.

IsConst

表示修改的型別具有 const 修飾詞。Indicates that the modified type has a const modifier. 這個類別無法被繼承。This class cannot be inherited.

IsCopyConstructed

表示複製這個型別的值時,必須使用此型別所提供的複製建構函式。Indicates that any copying of values of this type must use the copy constructor provided by the type. 這個類別無法被繼承。This class cannot be inherited.

IsExplicitlyDereferenced

表示 Managed 指標會表示方法簽章內的指標參數。Indicates that a managed pointer represents a pointer parameter within a method signature. 這個類別無法被繼承。This class cannot be inherited.

IsImplicitlyDereferenced

表示修改的記憶體回收參考會表示方法簽章內的參考參數。Indicates that the modified garbage collection reference represents a reference parameter within a method signature. 這個類別無法被繼承。This class cannot be inherited.

IsJitIntrinsic

表示修改的方法是 Just-In-Time (JIT) 編譯器可執行特殊程式碼產生作業的內建值。Indicates that a modified method is an intrinsic value for which the just-in-time (JIT) compiler can perform special code generation. 這個類別無法被繼承。This class cannot be inherited.

IsLong

表示修改的整數是標準 C++ long 值。Indicates that a modified integer is a standard C++ long value. 這個類別無法被繼承。This class cannot be inherited.

IsPinned

表示在記憶體中 Pin 修改的執行個體。Indicates that a modified instance is pinned in memory. 這個類別無法被繼承。This class cannot be inherited.

IsReadOnlyAttribute

將程式項目標示為唯讀。Marks a program element as read-only.

IsSignUnspecifiedByte

表示某個修飾詞既非 signed 也不是 unsigned。Indicates that a modifier is neither signed nor unsigned. 這個類別無法被繼承。This class cannot be inherited.

IsUdtReturn

表示傳回型別為使用者定義型別。Indicates that a return type is a user-defined type. 這個類別無法被繼承。This class cannot be inherited.

IsVolatile

標記欄位為 Volatile。Marks a field as volatile. 這個類別無法被繼承。This class cannot be inherited.

IteratorStateMachineAttribute

指出 Visual Basic 的方法是否以 Iterator 修飾詞標記。Indicates whether a method in Visual Basic is marked with the Iterator modifier.

IUnknownConstantAttribute

指示屬性欄位或參數的預設值為 UnknownWrapper 的執行個體,其中 WrappedObjectnullIndicates that the default value for the attributed field or parameter is an instance of UnknownWrapper, where the WrappedObject is null. 這個類別無法被繼承。This class cannot be inherited.

MethodImplAttribute

指定如何實作方式的詳細資料。Specifies the details of how a method is implemented. 這個類別無法被繼承。This class cannot be inherited.

NativeCppClassAttribute

將中繼資料 (Metadata) 套用至組件,表示某個型別為 Unmanaged 型別。Applies metadata to an assembly that indicates that a type is an unmanaged type. 這個類別無法被繼承。This class cannot be inherited.

ReadOnlyCollectionBuilder<T>

唯讀集合的產生器。The builder for read only collection.

ReferenceAssemblyAttribute

識別做為參考組件的組件,這個組件包含中繼資料但沒有可執行程式碼。Identifies an assembly as a reference assembly, which contains metadata but no executable code.

RequiredAttributeAttribute

指定匯入的編譯器 (Compiler) 必須完整了解型別定義的語意,或拒絕使用它。Specifies that an importing compiler must fully understand the semantics of a type definition, or refuse to use it. 這個類別無法被繼承。This class cannot be inherited.

RuleCache<T>

表示執行階段繫結規則的快取。Represents a cache of runtime binding rules.

RuntimeCompatibilityAttribute

指定是否使用 Exception 物件來包裝不是衍生自 RuntimeWrappedException 類別的例外狀況。Specifies whether to wrap exceptions that do not derive from the Exception class with a RuntimeWrappedException object. 這個類別無法被繼承。This class cannot be inherited.

RuntimeFeature

類別,其靜態 IsSupported(String) 方法會檢查 Common Language Runtime 是否支援指定的功能。A class whose static IsSupported(String) method checks whether a specified feature is supported by the common language runtime.

RuntimeHelpers

提供支援編譯器的靜態方法和屬性。Provides a set of static methods and properties that provide support for compilers. 這個類別無法被繼承。This class cannot be inherited.

RuntimeOps

包含從動態產生的方法所呼叫的 Helper 方法。Contains helper methods called from dynamically generated methods.

RuntimeWrappedException

包裝不是衍生自 Exception 類別的例外狀況。Wraps an exception that does not derive from the Exception class. 這個類別無法被繼承。This class cannot be inherited.

ScopelessEnumAttribute

表示列舉型別 (Enumeration) 名稱未限定原生 (Native) 列舉型別。Indicates that a native enumeration is not qualified by the enumeration type name. 這個類別無法被繼承。This class cannot be inherited.

SpecialNameAttribute

表示執行階段或工具會以特殊方式處理型別或成員。Indicates that a type or member is treated in a special way by the runtime or tools. 這個類別無法被繼承。This class cannot be inherited.

StateMachineAttribute

可讓您判斷方法是否為狀態機器方法。Allows you to determine whether a method is a state machine method.

StringFreezingAttribute

已取代。Deprecated. 使用 Ngen.exe (原生映像產生器) 建立原生映像時,凍結字串常值。Freezes a string literal when creating native images using the Ngen.exe (Native Image Generator). 這個類別無法被繼承。This class cannot be inherited.

StrongBox<T>

儲存值的參考。Holds a reference to a value.

SuppressIldasmAttribute

防止 Ildasm.exe (IL 反組譯工具) 將組件反組譯。Prevents the Ildasm.exe (IL Disassembler) from disassembling an assembly. 這個類別無法被繼承。This class cannot be inherited.

SwitchExpressionException

表示不完整的 switch 運算式無法符合它在執行階段的輸入。Indicates that a switch expression that was non-exhaustive failed to match its input at runtime. 例外狀況會選擇性地包含表示不相符值的物件。The exception optionally contains an object representing the unmatched value.

TupleElementNamesAttribute

指出應將成員上值元組的使用方式視為含有元素名稱的元組。Indicates that the use of a value tuple on a member is meant to be treated as a tuple with element names.

TypeForwardedFromAttribute

指定另一個組件中的來源 TypeSpecifies a source Type in another assembly.

TypeForwardedToAttribute

指定另一個組件中的目的 TypeSpecifies a destination Type in another assembly.

Unsafe

包含指標操作的一般低層級功能。Contains generic, low-level functionality for manipulating pointers.

UnsafeValueTypeAttribute

指定某個型別含有可能會溢位的 Unmanaged 陣列。Specifies that a type contains an unmanaged array that might potentially overflow. 這個類別無法被繼承。This class cannot be inherited.

結構

AsyncIteratorMethodBuilder

表示非同步迭代器的產生器。Represents a builder for asynchronous iterators.

AsyncTaskMethodBuilder

表示非同步方法產生器,會傳回工作。Represents a builder for asynchronous methods that return a task.

AsyncTaskMethodBuilder<TResult>

表示非同步方法的產生器,會傳回一項工作並提供結果參數。Represents a builder for asynchronous methods that returns a task and provides a parameter for the result.

AsyncValueTaskMethodBuilder

表示非同步方法產生器,會傳回 ValueTaskRepresents a builder for asynchronous methods that return a ValueTask.

AsyncValueTaskMethodBuilder<TResult>

表示會傳回 ValueTask<TResult> 的非同步方法產生器。Represents a builder for asynchronous methods that returns a ValueTask<TResult>.

AsyncVoidMethodBuilder

表示非同步方法產生器,不會傳回值。Represents a builder for asynchronous methods that do not return a value.

ConfiguredAsyncDisposable

提供可用來設定 IAsyncDisposable 上 await 執行方式的型別。Provides a type that can be used to configure how awaits on an IAsyncDisposable are performed.

ConfiguredCancelableAsyncEnumerable<T>.Enumerator

提供 awaitable 非同步列舉程式,啟用可取消反覆項目和已設定的 await。Provides an awaitable async enumerator that enables cancelable iteration and configured awaits.

ConfiguredCancelableAsyncEnumerable<T>

提供 awaitable 非同步列舉項目,啟用可取消反覆項目和已設定的 await。Provides an awaitable async enumerable that enables cancelable iteration and configured awaits.

ConfiguredTaskAwaitable

提供 awaitable 物件,啟用工作上之設定的等候。Provides an awaitable object that enables configured awaits on a task.

ConfiguredTaskAwaitable.ConfiguredTaskAwaiter

提供 awaitable (ConfiguredTaskAwaitable) 物件的 awaiter。Provides an awaiter for an awaitable (ConfiguredTaskAwaitable) object.

ConfiguredTaskAwaitable<TResult>.ConfiguredTaskAwaiter

提供 awaitable 物件 (ConfiguredTaskAwaitable<TResult>) 的 awaiter。Provides an awaiter for an awaitable object(ConfiguredTaskAwaitable<TResult>).

ConfiguredTaskAwaitable<TResult>

提供 awaitable 物件,啟用工作上之設定的等候。Provides an awaitable object that enables configured awaits on a task.

ConfiguredValueTaskAwaitable

提供 awaitable 型別,啟用 ValueTask 已設定的 await。Provides an awaitable type that enables configured awaits on a ValueTask.

ConfiguredValueTaskAwaitable.ConfiguredValueTaskAwaiter

ConfiguredValueTaskAwaitable 提供 awaiter。Provides an awaiter for a ConfiguredValueTaskAwaitable.

ConfiguredValueTaskAwaitable<TResult>.ConfiguredValueTaskAwaiter

提供 ConfiguredValueTaskAwaitable<TResult> 的 awaiter。Provides an awaiter for a ConfiguredValueTaskAwaitable<TResult>.

ConfiguredValueTaskAwaitable<TResult>

提供可等候型別,啟用 ValueTask<TResult> 上已設定的 await。Provides an awaitable type that enables configured awaits on a ValueTask<TResult>.

TaskAwaiter

提供等候非同步工作完成的物件。Provides an object that waits for the completion of an asynchronous task.

TaskAwaiter<TResult>

表示等候非同步工作完成,並提供結果參數的物件。Represents an object that waits for the completion of an asynchronous task and provides a parameter for the result.

ValueTaskAwaiter

ValueTask 提供 awaiter。Provides an awaiter for a ValueTask.

ValueTaskAwaiter<TResult>

ValueTask<TResult> 提供 awaiter。Provides an awaiter for a ValueTask<TResult>.

YieldAwaitable

以非同步方式切換到目標環境時,提供等候的內容。Provides the context for waiting when asynchronously switching into a target environment.

YieldAwaitable.YieldAwaiter

提供要切換至目標環境的 awaiter。Provides an awaiter for switching into a target environment.

介面

IAsyncStateMachine

表示針對非同步方法所產生的狀態機器。Represents state machines that are generated for asynchronous methods. 這個型別僅供編譯器使用。This type is intended for compiler use only.

ICriticalNotifyCompletion

表示在 await 作業完成時排程接續符號的 awaiter。Represents an awaiter that schedules continuations when an await operation completes.

INotifyCompletion

表示在作業完成時排程接續符號的作業。Represents an operation that schedules continuations when it completes.

IRuntimeVariables

表示執行階段變數的值。Represents the values of run-time variables.

IStrongBox

定義屬性,以存取物件所參考的值。Defines a property for accessing the value that an object references.

ITuple

定義一般用途的元組實作,允許存取元組執行個體成員,不需要知道基礎的元組類型。Defines a general-purpose Tuple implementation that allows access to Tuple instance members without knowing the underlying Tuple type.

列舉

CompilationRelaxations

指定參數,以便控制程式碼的嚴格程度,而此程式碼是由 Common Language Runtime 的 Just-In-Time (JIT) 編譯器所產生。Specifies parameters that control the strictness of the code generated by the common language runtime's just-in-time (JIT) compiler.

LoadHint

指定相依組件的慣用預設繫結。Specifies the preferred default binding for a dependent assembly.

MethodCodeType

定義方法實作的方式。Defines how a method is implemented.

MethodImplOptions

定義方法實作方式的詳細資料。Defines the details of how a method is implemented.

委派

ConditionalWeakTable<TKey,TValue>.CreateValueCallback

代表方法,這個方法會建立非預設值,以作為索引鍵/值組的一部分加入 ConditionalWeakTable<TKey,TValue> 物件。Represents a method that creates a non-default value to add as part of a key/value pair to a ConditionalWeakTable<TKey,TValue> object.

RuntimeHelpers.CleanupCode

表示發生例外狀況時要執行的方法。Represents a method to run when an exception occurs.

RuntimeHelpers.TryCode

表示應在 try 區塊中執行的程式碼委派。Represents a delegate to code that should be run in a try block.

備註

此命名空間主要是供編譯器撰寫者,雖然有幾個其類別,例如InternalsVisibleToAttribute,各式各樣的應用程式中使用。This namespace is primarily for compiler writers, although several of its classes, such as InternalsVisibleToAttribute, are used in a wide variety of applications.