A dynamic assembly is a .NET assembly that is created dynamically at runtime and hosts generated classes and methods. Usually created via reflection emit
Questions tagged [dynamic-assemblies]
51 questions
2
votes
3 answers
2-way Cross Process Communication
I am working on a project that i want to have a plugin-sandbox like System, However i am having issues working out 2-Way Real time Cross Process Communication. At first i thought of WCF, as it can pass object Metadata, but then soon realized that…

p1p3l1n3
- 51
- 2
- 4
2
votes
1 answer
How to copy a method from an existing assembly to a dynamic assembly in .NET Core?
I want to somehow add a method from an on disk assembly to an assembly I am generating, I am creating the assembly via the System.Reflection.Emit and saving it to a file using the Lokad.ILPack nuget package and loading it with AssemblyLoadContext…

Aether
- 64
- 6
2
votes
1 answer
TFS 2010 - WebDeployment - indirect referenced assembly missing
We've got the following problem:
solution-structure:
AutofacRegistration
References: Repositories.dll
WebApplication
References: AutofacRegistration.dll
In our web application we are referencing the AutofacRegistration.dll and this assembly…

rene_r
- 936
- 1
- 6
- 15
2
votes
0 answers
Predefined type 'System.Object' is not defined or imported
I have console application which should support scripts (.cs files) in order to change the behavior of the application. The problem is that I have 9 errors of type 'Predefined type is not defined or imported'
I've searched a lot and couldn't fix…

Expressingx
- 1,480
- 1
- 14
- 39
2
votes
0 answers
Where is an assembly being dynamically generated in this code?
My hybrid Excel Interop/EPPlus app for generating Excel spreadsheets runs progressively slower with each execution.
In trying to ferret out the reason for this, I downloaded ANTS Memory Profiler and ran the app.
ANTS MP tells me in its "Assemblies…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
2
votes
1 answer
C# Dynamic assembly Can't create new object and load to field
I am trying to create new object for given type and load it to the field, but it throws an
InvalidProgramException.
Doing same using locals works. Maybe doing something wrong with fields?
This does not work:
MethodAttributes getSetAttr =…

Druid
- 23
- 2
2
votes
1 answer
How can I generate this property implementation using Expressions instead of emitting IL?
I'm trying to generate classes at runtime that implement property getters with a body that calls a method on the generated class's base class. Here's an example of a simple interface, along with a hand-written implementation that I'm trying to…

quentin-starin
- 26,121
- 7
- 68
- 86
1
vote
0 answers
How to dynamically add an instance method to type from loaded assembly in runtime?
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…

Ruslan Muradasilov
- 93
- 1
- 7
1
vote
1 answer
Can I specify dependency directories when dynamically loading assemblies?
I'm wondering if a setup like this is possible:
c:\eflow\proxy.dll (main DLL loaded by application)
c:\eflow\application\dynamic.dll (DLL dynamically loaded by proxy.dll)
c:\eflow\dependency.dll (dependent DLL required by dynamic.dll)
Basically, I'd…

SofaKng
- 1,063
- 1
- 11
- 32
1
vote
1 answer
How to use a local object in a class dynamically generated with IL Emit
I'm not even sure if this is possible.. In a method I am creating a dynamic assembly, defining a type, and emitting IL for a constructor for that type. This method takes an IEnumerable as a parameter and I'd like to be able to use that…

quentin-starin
- 26,121
- 7
- 68
- 86
1
vote
1 answer
Create Dynamic Type in C# at run time
I am trying to create a c# class dynamically at run time.
using System;
class Hist
{
private int? _min;
private int? _max;
public int? min
{
get{return _min;}
set {_min = value;}
}
public int? max
{
get{return…

Narender
- 21
- 2
1
vote
0 answers
How do I unload and reload an assembly generated at runtime?
I'm working on a utility that will allow you to compile a piece of code while running. I'd like to put that code in a temporary assembly and load it.
var provider = new CSharpCodeProvider();
var parameters = new CompilerParameters {
…

benjamin.popp
- 547
- 1
- 6
- 20
1
vote
1 answer
What might cause this ExecutionEngineException?
I am trying to use Reflection.Emit to generate a wrapper class in a dynamic assembly. Automatic wrapper generation is part of a new open-source library I'm writing called "GoInterfaces".
The wrapper class implements IEnumerable and wraps…

Qwertie
- 16,354
- 20
- 105
- 148
1
vote
1 answer
Where .NET Assembly loaded from CodeBase goes?
I am loading a dll from an external place using < codebase > element in the application configuration.
I want to know where the assembly gets instantiated?
I made < codebase > to point to my local drive (outside of appbase) and also a network…

hak
- 11
- 3
1
vote
4 answers
Genetic Evolution of Source Code
I am curious about writing code in C# that "writes itself". I know that this is not possible in a broad sense, but I was thinking about setting up some kind of format for a dynamic assembly that defines everything except the body of some target…

Twiltie
- 572
- 1
- 6
- 13