ilgenerator Questions

2

Solved

I have this code that emits some IL instructions that calls string.IndexOf on a null object: MethodBuilder methodBuilder = typeBuilder.DefineMethod( "Foo", MethodAttributes.Public, typeof(void)...
Zalucki asked 16/9, 2018 at 0:28

4

Solved

I have to pass a function an instance of an object, so obviously all the information to be taken as argument is to be loaded onto the evaluation stack Here is the code that i am looking for someCl...
Amaranthaceous asked 14/2, 2011 at 7:15

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

5

Solved

Imagine we have a mutable struct (yes, don't start): public struct MutableStruct { public int Foo { get; set; } public override string ToString() { return Foo.ToString(); } } Using reflecti...
Benco asked 21/9, 2013 at 21:40

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

1

How can I dynamically modify MSIL code in-memory with C#/.NET? And yes, I'm really looking to replace existing code that's already in memory on the fly. Specifically, I'm not: Looking to only ge...
Unnecessarily asked 1/7, 2013 at 23:16

2

I am considering porting a third-party library to .NET for Windows Store apps. The library makes excessive use of System.Reflection.Emit.OpCodes via calls to the ILGenerator.Emit method overloads. ...

2

Solved

I'm generating wrappers for types by using System.Reflection.Emit. At one point it's possible that the original object is throwing a error on access ( FaultException ) and the error should be catch...
Blase asked 21/2, 2012 at 9:41

2

Solved

I need to create a class dynamically. Most things work fine but i'm stuck in generating the constructor. AssemblyBuilder _assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(new Assem...
Pinnati asked 10/4, 2012 at 14:7

4

Before all, I know about AutoMapper, and I don't want to use it. Because I'm learning C# and I want to receive a deep view of it. So I'm trying to do this issue (explained below) myself. However, ...
Shiller asked 18/3, 2012 at 20:51

1

Solved

Is it possible to use generics with the IL Generator? DynamicMethod method = new DynamicMethod( "GetStuff", typeof(int), new Type[] { typeof(object) }); ILGenerator il = method.GetILGenerator(...
Checkerbloom asked 21/3, 2012 at 19:22

2

Solved

I have write some function to create an exe file using ILGenerator. What I want is to show to user the IL language generated whithout using external tools like ILDasm or Reflector. during the exe...
Haemachrome asked 22/2, 2012 at 11:18

2

I was playing around with Reflection.Emit and found about about the little-used EmitCalli. Intrigued, I wondered if it's any different from a regular method call, so I whipped up the code below: us...
Hematite asked 5/5, 2011 at 5:22

3

Given following code: using System; using System.Reflection.Emit; using System.Diagnostics; using System.Reflection; namespace ConsoleApplication1 { class A { public int Do(int n) { return n...
Jolty asked 31/12, 2011 at 0:5

1

Solved

I'm making a sound synthesis program in which the user can create his own sounds doing node-base compositing, creating oscillators, filters, etc. The program compiles the nodes onto an intermediary...
Spannew asked 24/11, 2011 at 22:41

2

Solved

I want to populate an object's properties without using reflection in a manner similar to the DynamicBuilder on CodeProject. The CodeProject example is tailored for populating entities using a Data...
Sawfly asked 13/8, 2009 at 17:54

3

I'm using System.Reflection.Emit for a while now, and find it (who don't?) as painful as bug prone. Do you know if there is a good wrapper around the IL Generator, something that I can rely ...
God asked 13/10, 2008 at 8:26
1

© 2022 - 2024 — McMap. All rights reserved.