Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to statically link libraries for a C# ClassLibrary?

Tags:

c#

c#-2.0

I am creating a Class LLibrary in c# by using microsoft provided Dll's.

Now i want to statically add those Microsoft provided libraries to My Dll.How can i do this. I have simply added a reference to those Microsoft provided Dlls and creating My Dll? Is it fine or not?

if Microsoft provided dll is not available on other machine then my Dll may fails i need to add the libraries statically??

How can i do this??

like image 315
Cute Avatar asked Jul 09 '09 07:07

Cute


1 Answers

There's no such thing as statically linking to another assembly in .NET. There are some third party products such as .NET linker that merge assemblies into one but they are unsupported.

If you have the redistribution license for that library, you can ship a copy along with your assembly. In Visual Studio you can make this happen by setting "Copy Local" to "True" in the properties window for that assembly reference.

like image 97
mmx Avatar answered Sep 23 '22 14:09

mmx