问题描述
我想知道何时为引用设置 copy-local=true
是否有任何启发?
I am wondering if there are any heuristics for when to set copy-local=true
for references?
如果引用类型仅在内部使用,我可以将 copy-local
设置为 true
但如果引用类型作为参数或返回值公开,我设置 copy-local
到 false
并指示在应该使用我的库时应该引用依赖项的特定版本?
If referenced types are only used internally can I set copy-local
to true
but if referenced types are exposed as parameters or return values I set copy-local
to false
and indicate that a specific version of the dependency should be referenced when my library should be used?
谁能帮我澄清一下?
推荐答案
复制本地对于部署方案和工具很重要.作为一般规则,如果引用不包含在 GAC 中,您应该使用 CopyLocal=True.
Copy local is important for deployment scenarios and tools. As a general rule you should use CopyLocal=True if the reference is not contained within the GAC.
Copy Local 本质上意味着我必须手动部署这个 DLL 才能让我的应用程序正常工作.当它为 false 时,它本质上意味着我依赖于另一个必须单独安装或链接的组件,DLL 将已经存在".
Copy Local essentially means I must manually deploy this DLL in order for my application to work. When it's false it essentially means "I depend on another component which must be installed separately or chained, the DLL will just be there already".
这篇关于什么时候应该将 copy-local 设置为 true,什么时候不应该?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!