reflection.emit Questions

1

Solved

I am creating a new Assembly using System.Reflection.Emit. I want the new assembly to reference another assembly. There is a method GetReferencedAssemblies() that gets all the referenced assemblies...
Treatise asked 26/4, 2011 at 7:40

1

Solved

I am writing a compiler which generates on-disk .NET assemblies using the System.Reflection.Emit API. The compiler itself is built against .NET 4.5, but the generated code only references types fro...
Afterdeck asked 20/2, 2014 at 0:15

1

Solved

Overview (forgive me for being so detailed, but I'd rather it be too much than too little): I'm attempting to edit the Dapper source for our solution in such a way that when any DateTime or Nullabl...
Paxwax asked 11/2, 2014 at 19:29

2

How do tools like the Red Gate Ant Profiler or the Reflector convert IL into C# or VB.NET code? I recently noticed that the Red Gate Ant Profiler does not generate the same source code that was wr...
Brandabrandais asked 21/1, 2014 at 22:30

1

I'm using Reflection.Emit to develop a tool that dynamically creates an Assembly at runtime. The tool is targeting the .NET 4.5 framework. I'd like to know if it's possible to specify which .NET ...
Anglocatholic asked 16/12, 2013 at 12:14

1

Solved

I am trying to create a dynamic type based on an existing type that contains only public fields. The new dynamic type must also inherit from a different base type which only has a fully implemented...
Yetah asked 27/8, 2013 at 13:44

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

Solved

Why is the PropertyInfo methods for getting and setting a property so slow? If I build a delegate using Reflection.Emit, it is much faster. Are they doing something important, so that the time the...
Elspeth asked 7/10, 2012 at 7:56

2

Solved

[Name("Admin")] public class TestAdmin : TestUserBase<TestAdmin> { public TestAdmin(Type webDriverType) : base(webDriverType) { } } Currently, I have a bunch of classes of this form that...
Cardcarrying asked 10/6, 2013 at 21:8

1

Solved

I am porting code which uses DynamicMethods extensively to allow for precompilation, for better cold startup performance. I noticed that DynamicMethods can be JITted and executed with visibility ch...
Bouffe asked 4/4, 2012 at 13:32

2

Solved

Is there a performance difference between creating a method emitting IL directly, as opposed to building an expression tree?
Serif asked 13/5, 2013 at 20:27

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 have an application where I have a method taking a PropertyInfo parameter and would like to call this method from IL. For similar methods taking a MethodInfo, for example, I can create an interme...
Covarrubias asked 18/11, 2012 at 15:54

3

Solved

I made a generator class that build a proxy class based on interface which implement the interface. See my post on Build a Proxy class based on Interface without implementing it. I'm familiar wit...
Fanfani asked 9/4, 2013 at 7:24

2

Solved

I'm having yet another nasty moment with Reflection.Emit and type management. Say, I have a type named MyType which is defined in the dynamically generated assembly. Calling MyType.GetMethods() re...
Indestructible asked 26/3, 2013 at 20:35

1

Solved

I'm making a .NET-compliant compiler using Reflection.Emit. The problem is, that although TypeBuilder is derived from Type, it does not let me use all the handy methods that Type provides. The mat...
Upshot asked 5/1, 2013 at 16:33

1

Solved

I'm initializing an integer variable like this: LocalBuilder a = ilGen.DeclareLocal(typeof(Int32)); How can I access it and assign a value to it? I want to do something like this: int a, b; a =...
Subcritical asked 7/3, 2013 at 18:7

1

Solved

I want to dynamically create assemblies in the integration tests for the purpose of testing some assembly manipulation classes. If I use the following code to create the testing assemblies: var do...
Principate asked 20/11, 2012 at 7:8

1

Solved

I would like to emit a method that has a variable, which I can do. But, I would like to store in that variable a MethodInfo object, which is a reference to a different (non emitted) method. I cou...
Loiretcher asked 10/2, 2013 at 7:2

3

Solved

I tried running the sample code which appears on the documentation page for the System.Reflection.Emit.LocalBuilder class but it appears that the calls to LocalBuilder.SetLocalSymInfo(string, int, ...
Herriot asked 12/2, 2012 at 22:56

1

I'm working on a compiler using System.Reflection.Emit, and I'm getting JIT limitation errors I can't figure out. The problem occurs in my implementation of function handles. I.e. generating the co...
Coseismal asked 4/2, 2013 at 16:2

2

Solved

I'm working on a proxy and for generic classes with a reference type parameter it was very slow. Especially for generic methods (about 400 ms vs 3200 ms for trivial generic methods that just return...
Fielder asked 28/1, 2013 at 20:41

1

A read about creating types at runtime and i found it amazing. My goal is to create this class: [DelimitedRecord(",")] public class Person { [FieldOrder(0)] private string firstName; [FieldOr...
Hughett asked 23/1, 2013 at 12:59

2

So, I recently did some experimenting and discovered that it appears that Reflection.Emit doesn't support all of the opcodes in the ECMA spec. There are 3 opcodes missing: ldelem.any stelem.any ...
Day asked 21/11, 2012 at 16:23

2

Solved

Can someone explain to me what needs to be loaded into the stack prior to making a function call via reflection.emit? I have a very simple method public static void Execute(string 1, string 2) ...
Perishing asked 11/1, 2013 at 1:37

© 2022 - 2024 — McMap. All rights reserved.