Questions tagged [dynamic-assemblies]

A dynamic assembly is a .NET assembly that is created dynamically at runtime and hosts generated classes and methods. Usually created via reflection emit

51 questions
1
vote
1 answer

Loading an assembly / module into a dynamic assembly

I have one assembly that's created already, say Static.dll, and a dynamic assembly I'm creating at runtime, say Dynamic. Dynamic creates some IL code to create a new type from Static.dll. When Dynamic is created (it saves successfully), the…
OnResolve
  • 4,016
  • 3
  • 28
  • 50
0
votes
0 answers

Dynamically load assembly at runtime and return a data model class

Please correct me if the terminology is incorrect. I'm loading an assembly at runtime and running a method from it. The return part is where I'm having trouble. string path = @"C:\path\to\class.dll"; Assembly assembly = Assembly.LoadFrom(path); Type…
0
votes
0 answers

ASP.Net core web app not unloading other Razor Assembly which were loaded dynamically

I am having a razor web app where few other razor web app are added dynamically using AssemblyLoadContext Assembly assembly = _loadContext.LoadFromAssemblyPath(pluginLocation); Since razor app assembly are added over run time it was required to add…
0
votes
1 answer

Can you dynamically load a DLL associated with a currently loaded project then have the visual studio debugger break

I want to be able to have a solution where Project A does NOT reference project B I hit build all building both project A and project B Project A is run and dynamically loads the DLL built in 2. via Assembly.Load There is a breakpoint in project B…
Nick
  • 920
  • 1
  • 7
  • 21
0
votes
1 answer

Load A Assembly in Runtime and call a Method and unload the assembly

Im creating an application, wich will conect to several sql database and get some details form the database, In this application i have to encrypt the database connection details such as user name passwords. yes its pritty straight forward and…
Prabhakantha
  • 660
  • 5
  • 13
0
votes
0 answers

CLR Error when using RunAndCollect rather than RunAndSave

When dynamically generated assemblies, we regularly get this exception: Managed Debugging Assistant 'FatalExecutionEngineError' Message=Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The…
Nick
  • 920
  • 1
  • 7
  • 21
0
votes
0 answers

Is there an event fired when a .NET collectable assembly is garbage collected (e.g. an Assembly emitted with RunAndCollect)

Is there an event fired when a .NET collectable assembly is garbage collected (e.g. an Assembly emitted with RunAndCollect). Something like AppDomain.AssemblyLoad Event?
Nick
  • 920
  • 1
  • 7
  • 21
0
votes
0 answers

what's the purpose of calling TypeBuilder.CreateType()

I have difficulty in understanding in creating a dynamic assembly, below is some code: public static void CreateMyAsm(AppDomain curAppDomain) { AssemblyName assemblyName = new AssemblyName(); assemblyName.Name = "MyAssembly"; …
user11680003
0
votes
2 answers

Dynamically loading an assembly which expects GAC assemblies which are not actually available?

What happens if an application tries to load an assembly which has references to assemblies in the GAC and these assemblies are not available on the machine? Basically I want to rely on assembly loading succeeding to assume that the referenced…
NVM
  • 5,442
  • 4
  • 41
  • 61
0
votes
1 answer

Compile at runtime with referenced assemblies

I have created a function to compile C# code in a string in memory and use it at runtime. It works very well. Next I created a small class library (lets call it mynew.dll) and placed it at c:\mylibraries\mynew.dll. In my code I can add a referenced…
user1140479
0
votes
1 answer

Visual Studio console output of external program started from library project using dynamic assembly loading

I have created a simple test solution consisting of 3 projects: The first project is a class library containing an interface ITest with a method void DoSomething() The second project is also a class library containing a class Test which implements…
xxtesaxx
  • 6,175
  • 2
  • 31
  • 50
0
votes
1 answer

How to Test Drive building a dynamic assembly

I'm working on building a Dynamic context driver for LINQPad for IBM Db2 databases. I've been test driving the majority of the code, and I think I'm about done getting all the information I need about the database that I need. (I might need more…
Robert Snyder
  • 2,399
  • 4
  • 33
  • 65
0
votes
1 answer

Extension Method in Dynamically Generated Assembly?

I'm trying to include an extension methods static class in a dynamically generated assembly, except that i keep getting a compiler error of 'Type expected' at line 6, column 28, which happens to be on the word 'this'. If i remove 'this' no error is…
brianc
  • 1,547
  • 3
  • 16
  • 30
0
votes
2 answers

Does this class stay created?

I'm dynamically loading an assembly, creating an instance of a class that implements IRegisterable, then calling a registration method with this shortened code: public bool RegisterASM(string path) { Assembly asm =…
Jacob Lambert
  • 7,449
  • 8
  • 27
  • 47
0
votes
1 answer

Fluent NHibernate can not auto create mappings for a dynamic assembly

I am working on a legacy code base that builds some of its entities on the fly.I'd like to be able to add these entities to my auto persistent model using AddEntityAssembly like this : var model =new AutoPersistenceModel() …
Beatles1692
  • 5,214
  • 34
  • 65