NuGet 不更新项目引用 [英] NuGet not updating project references

查看:57
本文介绍了NuGet 不更新项目引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将我所有的 Visual Studio 2013 项目迁移到 Visual Studio 2015 并按照此 文章 由 Nuget 以确保自动包恢复仍然有效,简而言之

I recently migrated all my Visual Studio 2013 projects to Visual Studio 2015 and followed the steps documented in this article by Nuget to make sure that automatic package restore is still working, in short

  • 我从源代码管理和磁盘中删除了 Nuget.exe 和 Nuget.target 文件
  • 我更新了所有项目文件并删除了与 Nuget 相关的部分

我在更新 Nuget 包时遇到问题,它没有更新项目引用以指向最新的 dll 版本.我可以看到安装了最新的软件包.此问题也与特定包无关.

I'm experiencing a problem when I'm updating Nuget packages, it is not updating the project references to point to the newest dll versions. I can see that the newest packages was installed though. This problem is also not related to specific packages.

有没有其他人遇到过这样的问题?

Has anyone else experienced a problem like this?

推荐答案

我们意识到我们的一些初级开发人员只为解决方案中的一个项目安装了所需的 Nuget 包,然后他们为所有其他项目添加了对所需 dll 的引用通过浏览到 dll 在磁盘上的物理位置.这显然导致了问题,因为解决方案中只有一个项目在它的 packages.config 文件中包含 Nuget 包的条目,而解决方案中的其余项目不包含任何条目.

We realized that some of our junior developers only installed the required Nuget packages for ONE project in the solution, they then added references to the required dll's for all other projects by browsing to the physical location of the dll's on disk. This obviously caused the problem because only ONE of the projects in the solution contained entries for Nuget packages in it's packages.config file while the remaining projects in the solution contained none.

当使用 Update-Package 命令更新所有包时,只有一个项目在它的 packages.config 文件中包含条目被更新为正确的项目引用.

When all packages were updated using the Update-Package command only the ONE project containing entries in it's packages.config file were updated with the correct project references.

即使这不是 Nuget 错误,而是由经验不足引起的问题,我还是记录了一个 问题 与 Nuget 合作,看看他们是否可以改进软件以防止出现此类问题.

Even though this is not a Nuget bug and rather a problem caused by inexperience, I logged an issue with Nuget to see if they can improve the software to prevent these types of problems.

这篇关于NuGet 不更新项目引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆