如何将附属程序集添加到 Visual Studio 中的项目

发布于 2024-08-13 19:28:33 字数 223 浏览 8 评论 0原文

我正在从事一个引用第三方公司的程序集的项目。这些程序集具有附属程序集,我将其与构建后事件一起复制到 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?

Thanks in advance.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

め可乐爱微笑 2024-08-20 19:28:33

它在 C# IDE 中是自动的。在程序集引用上设置 Copy Local = True 可确保附属程序集也被复制。在 C++ IDE 中,它是一个设置:框架 + 引用、构建属性类别、“复制本地卫星程序集”。

您的问题中没有足够的信息来缩小您使用的 IDE 的范围或为什么它不适合您。也许第三方正在做一些不标准的事情。给他们打电话。

It is automatic in the C# IDE. Setting Copy Local = True on the assembly reference ensures that the satellite assemblies get copied as well. In the C++ IDE it is a setting: Framework + References, Build properties category, "Copy Local Satellite Assemblies".

There's not enough info in your question to narrow down which IDE you use or why it wouldn't work for you. Maybe that 3rd party is doing something non-standard. Give them a call.

黯然 2024-08-20 19:28:33

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

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

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).

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.

屋檐 2024-08-20 19:28:33

在引用中,右键单击并选择对第三方程序集的引用的属性。

确保“复制本地”为真。

如果这是真的,那么它应该复制附属程序集,因为这是我在 Visual Studio 中经历过的行为。

In the references, right click and select properties on your reference to the third party assembly.

Ensure that "copy local" is true.

If this is true, then it should copy the satellite assemblies, as this is the behavior I've experienced in Visual Studio.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文