[英]Do I need to move external libraries with my application for each device
In order to use an external library in my C# project we need to add it as an assembly reference in form of dll files as the pic below: 为了在我的C#项目中使用外部库,我们需要将其作为dll文件形式的程序集引用添加,如下图所示: but by this way, do I need to put the dll files along with my application in each machine I move my app? 但是通过这种方式,我是否需要在移动我的应用程序的每台计算机中将dll文件和应用程序一起放置? or they will be embedded in my application and so no need to always carry them ? 还是它们将被嵌入到我的应用程序中,因此无需始终携带它们?
You can either copy references with the project, embed the libraries as resources , or use ILMerge to generate one large executable. 您可以将引用复制到项目中,也可以将库作为资源嵌入 ,也可以使用ILMerge生成一个大型可执行文件。 However unless you have a STRONG reason to NOT copy the reference assemblies I would stick with the standard practice of copying the referenced assemblies. 但是,除非有很强的理由不复制参考程序集,否则我将坚持复制参考程序集的标准做法。 (wanting to have just one file for simplicity is not a strong reason to me). (为简单起见,只希望有一个文件对我来说并不是一个强烈的理由)。
Framework ( System.*
) libraries will be installed in the GAC on the target machine so you won't have to deploy them. 框架( System.*
)库将安装在目标计算机上的GAC中,因此您无需部署它们。
Any non-system libraries will either need to be installed in the GAC (ether by you or by a 3rd party installer for their libraries) or copied with the solution. 任何非系统库都将需要安装在GAC中(由您自己或由第三方安装程序来安装其库)或与解决方案一起复制。
For that there's a property within your reference properties window called Copy Local
. 为此,您的参考属性窗口中有一个名为Copy Local
属性。 If this property is set to true, the reference is copied to the output path of the project at run time. 如果将此属性设置为true,则引用将在运行时复制到项目的输出路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.