Visual Studio 将 dll 引用复制到输出文件夹 [英] visual studio copy dll references to output folder

查看:33
本文介绍了Visual Studio 将 dll 引用复制到输出文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试扩展某个应用程序.我正在使用与该应用程序捆绑在一起的 DLL 来扩展其功能.我正在使用 Visual Studio 2010 速成版.我添加了对 dll 库的引用.在参考属性中,复制本地"选项被禁用.(变灰)为什么会这样?我希望 Visual Studio 将 dll 复制到我的发布文件夹.如果无法做到这一点,是否还有其他方法可以捆绑 dll?

I am trying to extend a certain application. I am using a DLL which comes bundled with that application to extend its functionality. I am using visual studio 2010 express edition. I added a reference to the dll library. In the reference properties the option "Copy local" is disabled.(greyed out) why is that? I want visual studio to copy the dll to my release folder. If this can't be done is there another way to bundle the dll?

推荐答案

您对 Hans 回答的评论表明这是一个 COM 程序集并且您使用的是 Visual Studio 2010.

Your comment to Hans answer indicates this is a COM assembly and that you are using Visual Studio 2010.

这意味着程序集引用可能是在嵌入互操作类型"设置为 true 的情况下添加的.这具有将 COM 程序集链接到二进制文件的效果,无需完全部署它.下面的链接有更详细的解释

This means the assembly reference was likely added with the "Embed Interop Types" setting set to true. This has the effect of linking the COM assembly into your binary removing the need to deploy it altogether. The following link has a more detailed explanation

如果您确实想部署它,则需要执行以下操作

If you do want to deploy it though then will need to do the following

  • 点击参考标签中的参考
  • 按 F4 调出属性网格
  • 将嵌入互操作类型"设置为 False(这将取消复制本地)
  • 将复制本地"设置为 true

这篇关于Visual Studio 将 dll 引用复制到输出文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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