32 instantiations of DynamicMethod
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Implementation\RedisProfilerEntryToActivityConverter.cs (1)
212DynamicMethod getterMethod = new DynamicMethod(methodName, typeof(TField), new[] { typeof(object) }, true);
dotnet-svcutil-lib (2)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (1)
211_dynamicMethod = new DynamicMethod(methodName, returnType, argTypes, SerializationModule, allowPrivateMemberAccess);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (1)
474DynamicMethod baseMessageImpl = new DynamicMethod("NonVirtual_Message", typeof(string), new Type[] { Globals.TypeOfException }, Globals.TypeOfException);
Microsoft.AspNetCore.Routing (1)
Matching\ILEmitTrieFactory.cs (1)
32var method = new DynamicMethod(
Microsoft.Extensions.AI.Tests (1)
Functions\AIFunctionFactoryTest.cs (1)
1425DynamicMethod dynamicMethod = new DynamicMethod(
Microsoft.Extensions.DependencyInjection (1)
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (1)
89var dynamicMethod = new DynamicMethod("ResolveService",
Microsoft.ML.Data (4)
Utils\ApiUtils.cs (4)
93var mb = new DynamicMethod("Peek", null, args, typeof(TOwn), true); 113var mb = new DynamicMethod("Peek", null, args, typeof(TOwn), true); 159var mb = new DynamicMethod("Poke", null, args, typeof(TOwn), true); 177var mb = new DynamicMethod("Poke", null, args, typeof(TOwn), true);
Microsoft.ML.Transforms (1)
Expression\MethodGenerator.cs (1)
29_method = new DynamicMethod(name, returnType, parameterTypes, thisType);
Microsoft.VisualBasic.Core (1)
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (1)
1383Dim InvokerMethod As New DynamicMethod("Invoker", ObjectType, {CallSiteBinderType, ObjectType, GetType(Object())}, True)
System.Linq.Expressions (2)
System\Dynamic\Utils\DelegateHelpers.cs (1)
226DynamicMethod dynamicThunkMethod = new DynamicMethod(thunkName.ToString(), returnType, paramTypes);
System\Linq\Expressions\Compiler\LambdaCompiler.cs (1)
74var method = new DynamicMethod(lambda.Name ?? ("lambda_method" + lambdaMethodIndex.ToString()), lambda.ReturnType, parameterTypes, true);
System.Private.DataContractSerialization (3)
System\Runtime\Serialization\CodeGenerator.cs (1)
134_dynamicMethod = new DynamicMethod(methodName, returnType, argTypes, SerializationModule, allowPrivateMemberAccess);
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (1)
186DynamicMethod dynamicMethod = new DynamicMethod(methodName, signature.ReturnType, paramTypes, typeof(JsonFormatReaderGenerator).Module, allowPrivateMemberAccess);
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (1)
121DynamicMethod dynamicMethod = new DynamicMethod(methodName, signature.ReturnType, paramTypes, typeof(JsonFormatWriterGenerator).Module, allowPrivateMemberAccess);
System.Private.Xml (1)
System\Xml\Xsl\IlGen\XmlILModule.cs (1)
171DynamicMethod methDyn = new DynamicMethod(name, returnType, paramTypes, s_LREModule);
System.Text.Json (11)
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (11)
36var dynamicMethod = new DynamicMethod( 85var dynamicMethod = new DynamicMethod( 198var dynamicMethod = new DynamicMethod( 255var dynamicMethod = new DynamicMethod( 344var dynamicMethod = new DynamicMethod( 369var dynamicMethod = new DynamicMethod( 393var dynamicMethod = new DynamicMethod( 625DynamicMethod dynamicMethod = new DynamicMethod( 697new DynamicMethod( 705new DynamicMethod( 713new DynamicMethod(
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\RegexLWCGCompiler.cs (1)
79var dm = new DynamicMethod(methname, Attribs, Conventions, returntype, paramTypes, hostType, skipVisibility: false);
System.Xaml (2)
System\Xaml\Runtime\DynamicMethodRuntime.cs (2)
464return new DynamicMethod(name, returnType, argTypes, _localType); 468return new DynamicMethod(name, returnType, argTypes, _localAssembly.ManifestModule);
80 references to DynamicMethod
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Implementation\RedisProfilerEntryToActivityConverter.cs (1)
212DynamicMethod getterMethod = new DynamicMethod(methodName, typeof(TField), new[] { typeof(object) }, true);
dotnet-svcutil-lib (3)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (2)
156private DynamicMethod _dynamicMethod; 180internal void BeginMethod(DynamicMethod dynamicMethod, Type delegateType, string methodName, Type[] argTypes, bool allowPrivateMemberAccess)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (1)
474DynamicMethod baseMessageImpl = new DynamicMethod("NonVirtual_Message", typeof(string), new Type[] { Globals.TypeOfException }, Globals.TypeOfException);
Microsoft.AspNetCore.Routing (1)
Matching\ILEmitTrieFactory.cs (1)
32var method = new DynamicMethod(
Microsoft.Extensions.AI.Tests (1)
Functions\AIFunctionFactoryTest.cs (1)
1425DynamicMethod dynamicMethod = new DynamicMethod(
Microsoft.Extensions.DependencyInjection (2)
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (2)
50public DynamicMethod DynamicMethod; 89var dynamicMethod = new DynamicMethod("ResolveService",
Microsoft.ML.Data (4)
Utils\ApiUtils.cs (4)
93var mb = new DynamicMethod("Peek", null, args, typeof(TOwn), true); 113var mb = new DynamicMethod("Peek", null, args, typeof(TOwn), true); 159var mb = new DynamicMethod("Poke", null, args, typeof(TOwn), true); 177var mb = new DynamicMethod("Poke", null, args, typeof(TOwn), true);
Microsoft.ML.Transforms (1)
Expression\MethodGenerator.cs (1)
18private DynamicMethod _method;
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
432[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.Emit.DynamicMethod))]
netstandard (1)
netstandard.cs (1)
1400[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.Emit.DynamicMethod))]
System.Linq.Expressions (10)
System\Dynamic\Utils\DelegateHelpers.cs (1)
226DynamicMethod dynamicThunkMethod = new DynamicMethod(thunkName.ToString(), returnType, paramTypes);
System\Linq\Expressions\Compiler\ILGen.cs (1)
473if (mb is DynamicMethod)
System\Linq\Expressions\Compiler\LambdaCompiler.cs (3)
74var method = new DynamicMethod(lambda.Name ?? ("lambda_method" + lambdaMethodIndex.ToString()), lambda.ReturnType, parameterTypes, true); 263Debug.Assert(_method is DynamicMethod); 288Debug.Assert(_method is DynamicMethod);
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (1)
588Debug.Assert(_method is DynamicMethod);
System\Linq\Expressions\Compiler\LambdaCompiler.Lambda.cs (4)
28Debug.Assert(_method is DynamicMethod); 95DynamicMethod? dynamicMethod = inner._method as DynamicMethod; 133Debug.Assert(_method is DynamicMethod);
System.Private.CoreLib (2)
System\Reflection\Emit\DynamicILInfo.cs (2)
15public DynamicMethod DynamicMethod { get { return default; } } 36public int GetTokenFor(DynamicMethod method)
System.Private.DataContractSerialization (4)
System\Runtime\Serialization\CodeGenerator.cs (2)
99private DynamicMethod _dynamicMethod = null!; // initialized in BeginMethod 110internal void BeginMethod(DynamicMethod dynamicMethod, Type delegateType, Type[] argTypes)
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (1)
186DynamicMethod dynamicMethod = new DynamicMethod(methodName, signature.ReturnType, paramTypes, typeof(JsonFormatReaderGenerator).Module, allowPrivateMemberAccess);
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (1)
121DynamicMethod dynamicMethod = new DynamicMethod(methodName, signature.ReturnType, paramTypes, typeof(JsonFormatWriterGenerator).Module, allowPrivateMemberAccess);
System.Private.Xml (5)
System\Xml\Xsl\IlGen\XmlILModule.cs (4)
171DynamicMethod methDyn = new DynamicMethod(name, returnType, paramTypes, s_LREModule); 187DynamicMethod? methDyn = methInfo as DynamicMethod; 267return ((DynamicMethod)_methods[name]!).CreateDelegate(typDelegate);
System\Xml\Xslt\XslCompiledTransform.cs (1)
230Delegate delExec = executeMethod is DynamicMethod dm
System.Reflection.Emit.Lightweight (1)
src\runtime\artifacts\obj\System.Reflection.Emit.Lightweight\Release\net11.0\System.Reflection.Emit.Lightweight.Forwards.cs (1)
4[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.Emit.DynamicMethod))]
System.Text.Json (29)
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (29)
36var dynamicMethod = new DynamicMethod( 74private static DynamicMethod CreateParameterizedConstructor(ConstructorInfo constructor) 85var dynamicMethod = new DynamicMethod( 184private static DynamicMethod CreateSingleParameterConstructor(ConstructorInfo constructor) 198var dynamicMethod = new DynamicMethod( 244private static DynamicMethod? CreateParameterizedConstructor(ConstructorInfo constructor, Type parameterType1, Type parameterType2, Type parameterType3, Type parameterType4) 255var dynamicMethod = new DynamicMethod( 338private static DynamicMethod CreateAddMethodDelegate( 344var dynamicMethod = new DynamicMethod( 365private static DynamicMethod CreateImmutableEnumerableCreateRangeDelegate(Type collectionType, Type elementType, Type enumerableType) 369var dynamicMethod = new DynamicMethod( 389private static DynamicMethod CreateImmutableDictionaryCreateRangeDelegate(Type collectionType, Type keyType, Type valueType, Type enumerableType) 393var dynamicMethod = new DynamicMethod( 415private static DynamicMethod CreatePropertyGetter(PropertyInfo propertyInfo, Type runtimePropertyType) 425DynamicMethod dynamicMethod = CreateGetterMethod(propertyInfo.Name, runtimePropertyType); 458private static DynamicMethod CreatePropertyGetter(PropertyInfo propertyInfo, Type declaringType, Type runtimePropertyType) 469DynamicMethod dynamicMethod = CreateGetterMethod(propertyInfo.Name, declaringType, runtimePropertyType); 512private static DynamicMethod CreatePropertySetter(PropertyInfo propertyInfo, Type runtimePropertyType) 522DynamicMethod dynamicMethod = CreateSetterMethod(propertyInfo.Name, runtimePropertyType); 550private static DynamicMethod CreateFieldGetter(FieldInfo fieldInfo, Type runtimeFieldType) 557DynamicMethod dynamicMethod = CreateGetterMethod(fieldInfo.Name, runtimeFieldType); 584private static DynamicMethod CreateFieldSetter(FieldInfo fieldInfo, Type runtimeFieldType) 591DynamicMethod dynamicMethod = CreateSetterMethod(fieldInfo.Name, runtimeFieldType); 615private static DynamicMethod CreateUnionTryGetValueAccessor(Type unionType, IReadOnlyList<KeyValuePair<Type, MethodInfo>> entries) 625DynamicMethod dynamicMethod = new DynamicMethod( 696private static DynamicMethod CreateGetterMethod(string memberName, Type memberType) => 704private static DynamicMethod CreateGetterMethod(string memberName, Type declaringType, Type memberType) => 712private static DynamicMethod CreateSetterMethod(string memberName, Type memberType) => 721private static T? CreateDelegate<T>(DynamicMethod? method) where T : Delegate =>
System.Text.RegularExpressions (7)
System\Text\RegularExpressions\CompiledRegexRunnerFactory.cs (2)
9internal sealed class CompiledRegexRunnerFactory(DynamicMethod scanMethod, object[]? searchValues, CultureInfo? culture) : RegexRunnerFactory 11private readonly DynamicMethod _scanMethod = scanMethod;
System\Text\RegularExpressions\RegexLWCGCompiler.cs (5)
57DynamicMethod tryFindNextPossibleStartPositionMethod = DefineDynamicMethod($"Regex{regexNum}_TryFindNextPossibleStartingPosition{description}", typeof(bool), typeof(CompiledRegexRunner), s_paramTypes); 60DynamicMethod tryMatchAtCurrentPositionMethod = DefineDynamicMethod($"Regex{regexNum}_TryMatchAtCurrentPosition{description}", typeof(bool), typeof(CompiledRegexRunner), s_paramTypes); 63DynamicMethod scanMethod = DefineDynamicMethod($"Regex{regexNum}_Scan{description}", null, typeof(CompiledRegexRunner), [typeof(RegexRunner), typeof(ReadOnlySpan<char>)]); 70private DynamicMethod DefineDynamicMethod(string methname, Type? returntype, Type hostType, Type[] paramTypes) 79var dm = new DynamicMethod(methname, Attribs, Conventions, returntype, paramTypes, hostType, skipVisibility: false);
System.Xaml (7)
System\Xaml\Runtime\DynamicMethodRuntime.cs (7)
294DynamicMethod dynamicMethod = CreateDynamicMethod($"{targetType.Name}DelegateHelper", 311DynamicMethod dynamicMethod = CreateDynamicMethod("CreateDelegateHelper", 329DynamicMethod dynamicMethod = CreateDynamicMethod($"{ctor.DeclaringType.Name}Ctor", 343DynamicMethod dynamicMethod = CreateDynamicMethod($"{factory.Name}Factory", 423DynamicMethod dynamicMethod = CreateDynamicMethod($"{getter.Name}Getter", 441DynamicMethod dynamicMethod = CreateDynamicMethod($"{setter.Name}Setter", 460private DynamicMethod CreateDynamicMethod(string name, Type returnType, params Type[] argTypes)