Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
146 views

I am trying to use .NET reflection to emit a class and some interfaces which the class implements. However, I cannot seem to correctly implement the interfaces that are generic, as that results in ...
pmikkelsen's user avatar
1 vote
1 answer
53 views

We have a local Web API used for internal clients to retrieve data. We use application/json to transport the data across the Web API. The retrieved JSON data has a simple structured class 'Response'. ...
Andrew Northcote's user avatar
0 votes
0 answers
24 views

I've created a dynamic Type similarly to how it is done in this answer. I'd like to be able to recreate/replace this type at runtime, but the only way I found to do so would be via unloading the whole ...
jeanluc162's user avatar
0 votes
0 answers
78 views

In the preceding C# code, I'm creating a dynamic method and adding a few IL instructions to it, and then invoking the dynamic method: var assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(new(&...
winscripter's user avatar
0 votes
0 answers
85 views

I do a lot of hashing in hot path; these hashing function looks something like this: f(input) mod size. I do not know size beforehand. When tested, I got a significant speedup from compiler ...
Vojtech G's user avatar
2 votes
2 answers
85 views

As a general rule, managed code is not supposed to be able to cause access violations. That happens in native code or in unsafe code. But somehow, with a bit of playing around with some Reflection....
Mason Wheeler's user avatar
1 vote
2 answers
157 views

I'm running math heavy code on GPU with ILGPU, I organized it in modular classes segregated by interfaces to implement different algorithms that are modular. Now ILGPU allows only to run static ...
CoffeDeveloper's user avatar
1 vote
1 answer
58 views

Sorry for this long question but I feel I have to provide a bit more background as my issue is very specific. Bigger picture I am developing on a Unity tool to be used specifically for Embedded Linux ...
derHugo's user avatar
  • 92.6k
0 votes
1 answer
53 views

I am generating an executable with System.Reflection.Emit (in .NET Framework, so I can save it to disk) and I want the generated exectuable to not have a console window (it should just perform some ...
Jonas's user avatar
  • 17
2 votes
1 answer
80 views

I use System.Reflection.Emit to create classes at runtime that implement various interfaces which contain methods and properties. When generating a class, I generate one concrete method for each ...
Mike Nakis's user avatar
1 vote
0 answers
257 views

I'm working on a .NET 7 WPF application that relies on a .NET Framework (4.8.1) library that uses Reflection.Emit (with AssemblyBuilder.Save). When I call methods from that library from my application,...
Jonas _'s user avatar
  • 172
-2 votes
1 answer
98 views

I have have the following classes A and B: public class A { } public class B { public static implicit operator A(B value) { return new A(); } } As expected, the following ...
tigrou's user avatar
  • 4,586
0 votes
0 answers
234 views

I am using System.Reflection in C# to create a dynamic object class at runtime. This is the example object class that I want to create at runtime. public class RequestForTest { public string ...
Đặng Đức's user avatar
0 votes
0 answers
89 views

We can assign a variable using EMIT which has a standard type such as string, etc. But how can I assign a non-standard type such as Type? DynamicMethod dynamicMethod = new ...
DamXosp4j's user avatar
  • 148
1 vote
1 answer
70 views

So I am attempting to create a class that will wrap up all the bits necessary to implement a single-instance application (SIA). It should be a drop-in replacement for Application.Run<T>(). ...
Sam Axe's user avatar
  • 33.8k
1 vote
2 answers
91 views

I want to dynamically create an assembly using the functionality provided System.Reflection.Emit. The assembly should be identical to the assembly that results from compiling the following C# code: ...
ackh's user avatar
  • 2,107
0 votes
1 answer
69 views

I have a generation framework that can generate dll using system.reflection.emit but have a case that i dont think can be solved with Emit, or atleast i have not figured out to do a minimal repro that ...
Poul K. Sørensen's user avatar
0 votes
1 answer
274 views

Consider the following C# code: var methodBuilder1 = typeBuilder.DefineMethod("GetMedalIds", MethodAttributes.Public | MethodAttributes.HideBySig, CallingConventions.HasThis, typeof(int[]), ...
Dantte's user avatar
  • 685
2 votes
1 answer
213 views

I have created an assembly, module and classes in a dynamic assembly using Reflection.Emit in .NET6. I unable to reference that assembly in my CSharpCompilation; I can't use MetadataReference....
Hayden Browne's user avatar
1 vote
0 answers
403 views

I have .NET 6.0 app which dynamically loads .NET Framework 4.8 assembly. Calling method from this assembly with reflection throws this exception: System.MissingMethodException: Method not found: '...
Ruslan Muradasilov's user avatar
0 votes
1 answer
191 views

I want to create dynamic function in my project, but the number of function parameters is not sure,maybe two,maybe three or more,and then i want to run a static function already in the project,the ...
BrandonHe's user avatar
0 votes
0 answers
477 views

I try to create a dynamic method in .NET which has an "in" parameter, but it throws an exception in the EmitCall line: public struct Context { public string MyString { get; set; } } ...
zgabi's user avatar
  • 414
0 votes
0 answers
49 views

I want to create some dynamic method whcih has 2 cycles: in first some N values are pushed onto evaluation stack, in second - these N values are popped from stack. But CreateMethod throws ...
Tadeusz's user avatar
  • 7,033
2 votes
1 answer
301 views

I am having an issue using TypeBuilder to dynamically create a derived type that has a static field of the base type, that is initialized to a new instance of the created type. Essentially, I want to ...
brent.reynolds's user avatar
0 votes
1 answer
1k views

I am trying to dynamically build a type with a method that calls into an external delegate by using System.Reflection.Emit. However when I try to call this method, my program crashes with the ...
Lázár Zsolt's user avatar

1
2 3 4 5
16