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

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

问题描述

我正在尝试扩展某些应用程序.我正在使用与该应用程序捆绑在一起的DLL来扩展其功能.我正在使用Visual Studio 2010 Express Edition.我添加了对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 Studio2010.

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天全站免登陆