简体   繁体   English

我是否需要为每个设备在应用程序中移动外部库

[英]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.

相关问题 在WinForms应用程序中使用外部DLL需要哪种配置? - Which configuration do I need to use an external DLL in a WinForms application? Windows服务使用外部库,我是否需要以某种方式向服务注册? - Windows service uses external libraries, do I need to somehow register those with the service? 如何在我的 c# 应用程序中专门使用设备? - How do I use a device exclusively in my c# application? 我的WPF应用程序的后端层中是否需要WCF层? - Do I need WCF layer in the backend layer of my WPF application? 如何为每个播放器对象赋予一个playerID属性,并使它们根据不同的输入移动? - How do I give my player object each a playerID attribute and make them move based on different inputs? 如果我的目标设备只是一种,我是否需要使用VisualStateManager? - Do I need to use VisualStateManager if my target device is only one kind? 如何在应用程序外部的窗口上设置“始终在顶部”标志/设置? - How do I set the 'always on top' flag/setting on a window that is external to my application? 如何编写外部连接字符串配置文件并使我的C#应用​​程序识别并读取它? - How do I write an external connection string config file and make my c# application recognize and read it? 将外部应用程序移动到屏幕的前面 - Move external application to the front of the screen 如何将嵌入式清单清单移动到外部.manifest文件? - How do I move an embedded manifest to external .manifest file?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM