当前位置:   article > 正文

为什么.net中引用dll文件属性窗口中的“复制到本地”属性不可用(Why is the Copy Local property for my reference disabled?)_引用属性复制本地false

引用属性复制本地false

原文地址:

http://stackoverflow.com/questions/15526491/why-is-the-copy-local-property-for-my-reference-disabled


总结:

在dll文件属性窗口中查看他的“签入互操作类型(Embed Interop Types)”属性是否被设置成true,如果是,

则改为false;

这时再看“复制到本地(Copy Local)”属性就会变为可用;


====

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

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

注意:

在将“签入互操作类型”变为false后,程序执行上要比以前要明显感觉到慢,所以在具体引用很多com的应用中,要注意。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/240338
推荐阅读
相关标签
  

闽ICP备14008679号