简体   繁体   English

什么在构建期间优先? nuget参考或项目参考

[英]What gets precedence during build? nuget reference or project reference

I have a .net solution that has two class library projects (Say A and B) that I am also publishing to a nuget server. 我有一个.net解决方案,它有两个类库项目(说A和B),我也发布到nuget服务器。

If I were to add A as a project reference as well as a nuget reference on B, what version of the A.dll should I expect in the bin folder of B when I compile? 如果我要添加A作为项目引用以及B上的nuget引用,那么当我编译时,我应该在B的bin文件夹中期望使用什么版本的A.dll?

Is there a rule which determines what reference gets precedence? 是否有规则确定哪个引用优先? What happens if the two dlls have different versions? 如果两个dll有不同的版本会发生什么?

PS - I am building from VS PS - 我是从VS建立的

This is moot question. 这是没有实际意义的问题。 Turns out you cannot have a referenced twice (as a project and nuget reference). 事实证明,你不能有两次引用(作为项目和nuget引用)。 Visual studio blocks you if you try to add a project reference if it already exists as a nuget reference and if you add a nuget reference when you already have a project reference of the same name then it gets overriden (your project reference goes away and is replaced by nuget reference) 如果您尝试添加项目引用(如果它已作为nuget引用存在),并且当您已经具有相同名称的项目引用时添加nuget引用,则Visual Studio会阻止您,它会被覆盖(您的项目引用会消失并且是由nuget引用替换)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM