reflection.emit Questions
6
Solved
What is the difference between the CIL instructions "Call" and "Callvirt"?
Lightfingered asked 11/10, 2008 at 10:26
1
Solved
In C#, how do I emit a new Type at runtime with .NET Core? All of the examples I can find for .NET 6 don't seem to work in .NET core (they all begin with getting the current AppDomain, which doesn'...
Caldera asked 21/1, 2017 at 20:54
1
Solved
IKVM.Reflection.Emit has "the ability to read and emit .NET 1.1, .NET 2.0 and .NET 4.0 assemblies (while running on, for example, .NET 2.0).".
Does Mono.Cecil have the same? Are they interchangabl...
Delacroix asked 21/10, 2015 at 11:30
1
One can store in a read only field of a class using strfld op code in dynamic method if it has its owner set to that class and JIT checks are turned off. An example is here. This approach, however,...
Goldi asked 13/8, 2015 at 13:44
3
Solved
I am experimenting with parsing IL in order to emit a method. I have gotten the IL code of a method in a string[] where each string is an IL instruction. I am looping over this array and adding OpC...
Nahama asked 20/7, 2011 at 18:42
2
Solved
I'm trying to use Reflection.Emit in C# to emit a using (x) { ... } block.
At the point I am in code, I need to take the current top of the stack, which is an object that implements IDisposable, s...
Sponson asked 8/6, 2010 at 15:49
4
Solved
In Microsoft IL, to call a method on a value type you need an indirect reference. Lets say we have an ILGenerator named "il" and that currently we have a Nullable on top of the stack, if we want to...
Boardman asked 16/9, 2008 at 19:57
2
Solved
Trying to create two dictionaries of emitted delegates to allow for improved performance when dynamically getting/setting the values of properties.
Code:
Properties = type.GetProperties(BindingF...
Spraggins asked 2/7, 2013 at 5:55
1
Solved
I am building a dynamic method using reflection. Most tutorials and documentation (e.g. How to: Define and Execute Dynamic Methods or Creating method dynamically, and executing it) show a very simp...
Trajan asked 22/1, 2016 at 16:18
2
Solved
I have code like this to emit IL code that loads integer or string values. But I don't know how to add the decimal type to that. It isn't supported in the Emit method. Any solutions to this?
ILGen...
Antifreeze asked 6/11, 2015 at 15:49
2
Solved
I'm trying to improve the performance of a certain part of my program which involves deep cloning the same object graph over and over across multiple threads. Currently I use serialization which is...
Hoebart asked 16/3, 2012 at 19:57
6
Solved
Let's say I have the following code which update a field of a struct using reflection. Since the struct instance is copied into the DynamicUpdate method, it needs to be boxed to an object before be...
Ventage asked 13/8, 2009 at 14:50
1
Solved
The Disassembly looks like:
methShort( ref x, ref y );
000007FF00163F67 lea r8,[rsp+34h]
000007FF00163F6C lea rdx,[rsp+30h]
000007FF00163F71 mov rcx,qword ptr [rsp+20h]
000007FF00163F76 mov rc...
Abm asked 30/4, 2015 at 16:40
1
Solved
I'm trying to call unmanaged printf-like function using DynamicMethod. At runtime I get a
BadImageFormatException:Index not found. (Exception from HRESULT:
0x80131124)
Is this a limitation o...
Atronna asked 5/4, 2015 at 15:0
1
Suppose we have an interface:
public interface ICalculator
{
decimal Calculate(decimal x, decimal y);
}
the calculate logic is implemented in javascript (actually is TypeScript) code, we want ...
Knowles asked 8/4, 2015 at 3:47
0
We want to dynamically create a class, the constructor as below:
public JsRF1013Wrapper(ScriptEngine scriptEngine, string jsFileFullPath)
{
this.ScriptEngine = scriptEngine;
var jsFileContent =...
Egest asked 9/4, 2015 at 8:56
2
Solved
I have some code that uses a MethodInfo of a generic method found on a generated type. To avoid some reflection, I have the code use the
ldtoken Method
ldtoken Type
call GetMethodFromHandle(Runti...
Greatest asked 7/1, 2013 at 16:52
2
Solved
I started using reflection in my project.
When I create a type and I want to specify the TypeAttributes, I have two options:
AnsiClass and Class. They are both set to 0 in the enum TypeAttributes....
Szombathely asked 11/3, 2015 at 14:24
1
Solved
I want to know what is fastest way to get value (only for this problem) from an object`s property ?
after some searching I saw a post from @MarkGravell in this site
He wrote this code :
using Sy...
Moschatel asked 4/11, 2014 at 9:2
1
Solved
When I remove Ldstr "a" and Call Console.WriteLine (before Ret), the code runs fine, otherwise an InvalidProgramException is thrown upon invocation. Does this mean that an empty evaluation stack is...
Bodwell asked 30/10, 2014 at 16:27
1
Solved
I just spent hours being confused by an NullReferenceException where I thought there shouldn't be one. I was constructing a class like so:
public class MyClass : MyBase<Foo>
{
public MyClas...
Barimah asked 11/9, 2014 at 13:11
6
(First of all, this is a very lengthy post, but don't worry: I've already implemented all of it, I'm just asking your opinion, or possible alternatives.)
I'm having trouble implementing the follow...
Sonnier asked 10/5, 2010 at 14:49
5
Solved
How can I set value into struct field - myStruct.myField with reflection using DynamicMethod? When I call setter(myStruct, 111) value was not set, because MyStruct is value type. Console.WriteLine(...
Ordinarily asked 2/9, 2014 at 19:55
1
Solved
I want to generate Types via reflection at runtime that reference each other.
With static code I would do this
public class Order
{
public int Id { get; set; }
public Customer Customer { ...
Chicalote asked 1/7, 2014 at 15:21
2
Solved
Is it possible to define a DynamicMethod with generic type parameters? The MethodBuilder class has the DefineGenericParameters method. Does the DynamicMethod have a counterpart? For example is it p...
Booher asked 25/4, 2009 at 9:51
© 2022 - 2024 — McMap. All rights reserved.