为什么供我参考复制本地属性被禁用? [英] Why is the Copy Local property for my reference disabled?

查看:279
本文介绍了为什么供我参考复制本地属性被禁用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置一个被引用的DLL显式复制到我的本地文件夹,但是当我去的属性,该参考值,复制本地属性是灰色的/禁用。

I am trying to set a referenced DLL to be explicitly copied to my local folder however when I go to the properties for this reference, the Copy Local property is grayed out / disabled.

通常我的VB.NET项目有正下方的项目名称,我可以双击我的项目项目>>引用和设置在复制本地属性但是我的C#控制台应用程序似乎,并不具备这一点。

Usually my VB.NET projects have a My Project item directly below the project name which I can double-click >> references and set the Copy Local property, however my C# console application does not seem to have this.

让我也许是我的配置不正确的项目?任何帮助将不胜感激。

Have I perhaps configured my project incorrectly? Any help on this will be greatly appreciated.

推荐答案

直接从该SO职位:

您对汉斯的答案评论指出,这是一个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组件链接到您的二进制文件不再需要部署它完全
的效果。下面的链接有更详细的解释
http://msdn.microsoft.com/en -us /库/ dd409610.aspx 如果你
希望部署它虽然然后将需要做以下•点击
的参考选项卡•按下F4键参考,弹出在
性能格•将嵌入互操作类型为False(这将ungray
复制本地)•将复制本地设置为true

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 •http://msdn.microsoft.com/en-us/library/dd409610.aspx If you do want to deploy it though then will need to do the following •Click on the reference in the references tab •Hit F4 to bring up the properties grid •Set "Embed Interop Types" to False (this will ungray Copy Local) •Set "Copy Local" to true

如果你想复制的地方,必须设置嵌入互操作类型的大会在你的情况,的Microsoft.Office.Interop.Excel 。嵌入互操作类型,使部署在更容易为COM组件它嵌入你的组件内的组件,带走了需要部署与应用程序互操作程序集。

If you want to copy local, you must set Embed Interop Types to False for the assembly, in your case, Microsoft.Office.Interop.Excel. Embed Interop Types makes deployment easier for COM assemblies in that it embeds the assemblies within your assembly, taking away the need to deploy interop assemblies with the application.

这篇关于为什么供我参考复制本地属性被禁用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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