From 683d3d21a3c1da9c740f4567ccea6389212a8bf3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 04:32:20 +0000 Subject: [PATCH 1/3] Initial plan From 0d28b60283f3936614f570dbdbd75b5dbd7c6d3d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 04:35:09 +0000 Subject: [PATCH 2/3] Add DynamicILInfo supplemental remarks documentation Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --- .../system-reflection-emit-dynamicilinfo.md | 20 +++++++++++++++++++ docs/fundamentals/toc.yml | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicilinfo.md diff --git a/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicilinfo.md b/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicilinfo.md new file mode 100644 index 0000000000000..bd3324d44dc46 --- /dev/null +++ b/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicilinfo.md @@ -0,0 +1,20 @@ +--- +title: System.Reflection.Emit.DynamicILInfo class +description: Learn about the System.Reflection.Emit.DynamicILInfo class. +ms.date: 02/12/2026 +ai-usage: ai-assisted +--- +# System.Reflection.Emit.DynamicILInfo class + +[!INCLUDE [context](includes/context.md)] + +The class allows developers to write their own MSIL generators instead of using . + +To create instances of other types, call methods, and so on, the MSIL you generate must include tokens for those entities. The class provides several overloads of the method, which return tokens valid in the scope of the current . For example, if you need to call an overload of the method, you can obtain a for that overload and pass it to the method to obtain a token to embed in your MSIL. + +Once you have created arrays for your local variable signature, exceptions, and code body, you can use the , , and methods to insert them into the associated with your object. + +Generating your own metadata and MSIL requires familiarity with the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics" and "Partition III: CIL Instruction Set". For more information, see [ECMA 335 Common Language Infrastructure (CLI)](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/). + +> [!NOTE] +> Don't use to generate code that creates a delegate to another dynamic method by calling the delegate constructor directly. Instead, use the method to create the delegate. A delegate that is created with the delegate constructor doesn't have a reference to the target dynamic method. The dynamic method might be reclaimed by garbage collection while the delegate is still in use. diff --git a/docs/fundamentals/toc.yml b/docs/fundamentals/toc.yml index 606e151dd3090..367ab9e6aa634 100644 --- a/docs/fundamentals/toc.yml +++ b/docs/fundamentals/toc.yml @@ -1551,6 +1551,8 @@ items: href: runtime-libraries/system-reflection-emit-dynamicmethod-invoke.md - name: IsSecurity* properties href: runtime-libraries/system-reflection-emit-dynamicmethod-issecuritycritical.md + - name: The DynamicILInfo class + href: runtime-libraries/system-reflection-emit-dynamicilinfo.md - name: The MethodBuilder class href: runtime-libraries/system-reflection-emit-methodbuilder.md - name: The PersistedAssemblyBuilder class From 619d292bf272a79c7c5b8d28cf2f921b9df8f026 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:46:55 -0800 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../runtime-libraries/system-reflection-emit-dynamicilinfo.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicilinfo.md b/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicilinfo.md index bd3324d44dc46..154e1c1aac1b9 100644 --- a/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicilinfo.md +++ b/docs/fundamentals/runtime-libraries/system-reflection-emit-dynamicilinfo.md @@ -8,9 +8,9 @@ ai-usage: ai-assisted [!INCLUDE [context](includes/context.md)] -The class allows developers to write their own MSIL generators instead of using . +Use the class to write your own MSIL generators instead of using . -To create instances of other types, call methods, and so on, the MSIL you generate must include tokens for those entities. The class provides several overloads of the method, which return tokens valid in the scope of the current . For example, if you need to call an overload of the method, you can obtain a for that overload and pass it to the method to obtain a token to embed in your MSIL. +To create instances of other types, call methods, access fields, or reference types, the MSIL you generate must include tokens for those entities. The class provides several overloads of the method, which return tokens valid in the scope of the current . For example, if you need to call an overload of the method, you can obtain a for that overload and pass it to the method to obtain a token to embed in your MSIL. Once you have created arrays for your local variable signature, exceptions, and code body, you can use the , , and methods to insert them into the associated with your object.