CreateAndInject
CreateAndInject
> The information regarding the declaring type is used to determine whether we should interpret the type as an unbound generic instantiation signature or retain original handling. @ElektroKill That's why...
I don't agree it's strange behavior, why there's `ImportDeclaringType` in dnlib many years ago? Since it's expected behavior rather than strange behavior. DynamicMethodBodyReader can generate such code more than 10...
> So everyone must use the Importer's constructor with gp context overload. This will change everyone's usage habits. @wwh1004 You don't like one PR change everyone's usage habits, but this...
```c# var mi = typeof(My).GetMethod("Test"); var md = (MethodDef)module.ResolveToken(mi.MetadataToken); var dm = DynamicMethodHelper.ConvertFrom(mi); ``` There's an issue, in my sample, `mi` and `dm` represent a same method, but I don't...
Let me say something like this: ```c# static void Do() { var dm1 = DynamicMethodBuilder.Build(1057); dm1.Invoke(null, ..args..); var dm2 = DynamicMethodBuilder.Build(9527); dm2.Invoke(null, ..args..); var dm3 = DynamicMethodBuilder.Build(15); dm3.Invoke(null, ..args..); }...
More clear: ```c# static void Do() { var walk = DynamicMethodBuilder.Build("walk"); walk.Invoke(null, ..args..); var run = DynamicMethodBuilder.Build("run"); run.Invoke(null, ..args..); var fly = DynamicMethodBuilder.Build("fly"); fly.Invoke(null, ..args..); var jump = DynamicMethodBuilder.Build("jump"); jump.Invoke(null,...
> If you don't know the the MethodDef corresponding to this dynamic method, how do you restore it? Why a dynamic method must have a corresponding MethodDef/MethodBase? original: ```c# static...
[ClassLibrary1.zip](https://github.com/0xd4d/dnlib/files/15268563/ClassLibrary1.zip) Add this file to references, and code following, how to prepare `originalDeclaringType`? My PR doesn't care about such issue and work well. I protected ClassLibrary1.dll to prevent people from...
@wtfsck As they can't resolve the issue I mentioned, can we eliminate this PR now?
> I think you are stretching this problem out and creating unreasonable and unrealistic scenarios to try to show that a fix you wanted is suddenly not necessary because this...