[英].NET deploying dlls that project does not use but referenced dlls require
So the problem is quite simple: My project references assembly X but not Z. But assembly X does reference assembly Z. Assembly Z updates somewhat frequently, so whenever I build my project, I'd like to get the latest version of Z as well. 所以问题很简单:我的项目引用程序集X但不引用Z。但是程序集X引用了程序集Z。程序集Z经常更新,因此无论何时构建我的项目,我都希望获得最新版本的Z。 。
So far I've come up with 3 options: 到目前为止,我已经提出了3种选择:
So, am I missing something, or are these my only options? 那么,我是否缺少某些东西,还是我唯一的选择?
I would go with option 1. I think it's entirely reasonable for your project to reference everything it depends on, even if those dependencies can sometimes be indirect. 我会选择选项1。我认为即使引用有时是间接的,对于您的项目来说,引用它所依赖的所有内容也是完全合理的。
It also seems like the simplest option to me - and one which fits in with Visual Studio's view of code dependencies that your app requires... so anything that Visual Studio does with those dependencies should just naturally flow, rather than you having to think about this at every stage. 在我看来,这似乎是最简单的选择-并且与Visual Studio的应用程序所需的代码依赖关系视图相适应...因此,Visual Studio对这些依赖关系所做的任何事情都应该自然而然地产生,而不是您必须考虑在每个阶段。
EDIT: As an alternative option, have you considered using NuGet ? 编辑:作为替代选项,您是否考虑过使用NuGet ? That way you'd only express a dependency on X within your project's NuGet dependencies, but it would "know" that it depended on Z. I believe it should all just work... You should be able to do this even if these are internal projects, as you can set your own NuGet source rather than the public repository. 这样,您只需要在项目的NuGet依赖关系中表达对X的依赖关系,但就可以“知道”它依赖于Z。我相信它都应该可以工作...即使这些都可以,您也应该能够做到这一点内部项目,因为您可以设置自己的NuGet源而不是公共存储库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.