Studio中将附属程序集添加到项目中

Studio中将附属程序集添加到项目中

本文介绍了如何在Visual Studio中将附属程序集添加到项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个项目中工作,该项目引用了第三家公司的装配体.这些程序集具有附属程序集,我将通过构建后事件将其复制到bin文件夹中.

I'm working in a project which references assemblies from a third company. These assemblies have satellite assemblies that I'm copying with a post-build event to the bin folder.

是否有一种方法可以将那些第三方附属程序集包含到项目中,这样我就不必在意构建后事件和维护文件了?

Is There a way to include those third party satellite assemblies into the project so I have not to care with the post-build events and maintaining the files?

谢谢.

更多信息:由于引用仅具有资源,因此不会将它们添加为项目引用,实际上,我只是将它们复制到//文件夹中.由于每个本地化的引用都具有相同的名称,所以我只能将其一次添加到项目的引用中.

MORE INFORMATION: As the references have only resources they are not added as project references, actually I'm just copying them to the // folder. As each localized reference has the same name I would only be able to add it one time to the project's references.

推荐答案

我正在研究一个相关问题,偶然发现了这个线程.请注意,直接引用附属程序集(通过添加引用"对话框)不是将它们合并到您的应用程序中的方法.相反,只需确保它们位于上面建议的文件夹层次结构中(相对于它们包含资源的二进制文件的原始位置).

I was researching a related problem and stumbled on this thread. Please note that referencing the satellite assemblies directly (via the 'add reference' dialog) is not the way to incorporate them into your application. In stead just make sure they are located in a folder hierarchy as suggested above (relative to the original location of the binary file they contain resources for).

您唯一显式添加引用的文件是库本身.请记住在参考的属性窗口中将"copy local"设置为true.然后,运行时将确保从目录与系统区域设置匹配的文件中提取资源.

The only file you add a reference to explicitly is the library itself. Do remember to set 'copy local' to true in the property window of the reference. The runtime will then make sure to pull resources from the file whose directory matches the system locale.

这篇关于如何在Visual Studio中将附属程序集添加到项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 07:25