我有一个非常奇怪的错误,我无法解释.
所以我的设置很简单:
我有一个包含 2 个项目的解决方案,我们将它们命名为 ProjectA 和 ProjectB.ProjectA 引用了一些 NuGet 包,如果我构建 ProjectA,我可以看到输出目录中的所有程序集,即 bin 文件夹.ProjectB 现在引用 ProjectA,但是如果我构建 ProjectB,我在输出目录中有 ProjectA 程序集,但是不是从 ProjectA 引用的 NuGet 包.
ProjectB 到 ProjectA 的引用是通过 References -> Add Reference... -> Solution -> ProjectA 添加的.p>
我还创建了一个涵盖此案例的小测试项目,但它在我的测试项目中运行良好.
有什么想法吗?
解决方案如果依赖关系图比你描述的更复杂,你可能会遇到一些版本问题.
X, Version=2, Culture=neutral, PublicKeyToken=null"和X, Version=1, Culture=neutral, PublicKeyToken=null"之间存在冲突.
选择X, Version=2, Culture=neutral, PublicKeyToken=null"是因为它是主要的,而X, Version=1, Culture=neutral, PublicKeyToken=null"不是.
I have a very strange error I have no explanation for.
So my setup is very simple:
I have a solution with 2 projects, let's name them ProjectA and ProjectB. ProjectA references some NuGet packages and if I build ProjectA, I can see all assemblies in the output directory, the bin folder. ProjectB now references ProjectA, but if I build ProjectB, I have the ProjectA assembly in the output directory, but not the NuGet packages referenced from ProjectA.
The reference from ProjectB to ProjectA is added with References -> Add Reference... -> Solution -> ProjectA.
I also created a little test project covering this case, but it works just fine in my test project.
Any ideas?
解决方案If the dependency graph is more complex than what you described you might have some versioning issues.
There was a conflict between "X, Version=2, Culture=neutral, PublicKeyToken=null" and "X, Version=1, Culture=neutral, PublicKeyToken=null".
"X, Version=2, Culture=neutral, PublicKeyToken=null" was chosen because it was primary and "X, Version=1, Culture=neutral, PublicKeyToken=null" was not.
更多推荐
未从引用项目复制的 NuGet 包
发布评论