如何静态链接C#ClassLibrary的库? [英] How to statically link libraries for a C# ClassLibrary?

查看:254
本文介绍了如何静态链接C#ClassLibrary的库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Microsoft提供的Dll在c#中创建Class LLibrary。



现在我想将那些Microsoft提供的库静态添加到My Dll。我该怎么做。
我只是添加了对那些Microsoft提供的Dll并创建My Dll的引用?



如果Microsoft提供的dll在其他计算机上不可用,那么我的Dll可能会失败,我需要静态添加库?



我该怎么做?

解决方案

没有静态链接到.NET中的另一个程序集。有一些第三方产品,例如 .NET链接器,它们将程序集合并为一个,但不受支持。 / p>

如果您具有该库的重新分发许可证,则可以将其副本与程序集一起提供。在Visual Studio中,您可以通过在该程序集引用的属性窗口中将复制本地设置为真来实现此目的。


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??

解决方案

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.

这篇关于如何静态链接C#ClassLibrary的库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆