Loading C # dll into C # exe

I'm new to C #, can anyone please tell me how to load a DLL created in C # into an exe in C #

I have .NetFrameWork 3.5 and my os Vista p>

+2


source to share


3 answers


Add a link and include the appropriate namespaces.



.NET does not support statically linking libraries, so your referenced assemblies will be loaded at runtime as needed.

0


source


Here is a quick google result on what I assume is your actual question: How to add or remove links in Visual Studio . There are a few minor differences between Visual Basic and C #, but the article and any links explain it all.

Basically, create a DLL reference in your project file in Visual Studio, add the appropriate statement using

to the required namespace, and specify whatever class you like in the dll.

If you are not using Visual Studio and project files, the above link will help you build from the command line. For example,csc /out:TestCode.exe /reference:MathLibrary.DLL TestCode.cs



If that's not what you're looking for , try this: Dynamically Loading .NET DLL Files (Build Plugin, On System) - C # . Here's a more complex model: Plugin architecture using C #

Oh, also, since you are new to C #, this might be useful to you in general : Visual C # Developer Center - New to Development

+2


source


If you add a DLL reference to your project, it will be loaded when needed.

+1


source







All Articles