Nuget Package updates & Package.config remove issue (TF400024)

为君一笑 提交于 2019-11-30 11:13:37

A simple check-in of the code to Visual Studio Online did the trick for me.

What's happening here (likely) is that you had a previous version (or the same version) of the .dll as a reference, and at SOME point (whether you did it or VS did it), it removed the reference. While you're not seeing the reference in the folder, the TFS / GIT checkin process is still waiting to "check in" the fact that you've removed it. So if you haven't checked in this fact, VS thinks it's still there, when in reality it's not. You can verify this in the Team Explorer area where you should be able to see the removed .dll (indicated by a line through it).

Kinda stupid, but that's how it goes.

I had this problem too.

To resolve that:

  1. Open your Source Control Explorer (Team Foundation)
  2. Locate the 'packages' folder of solution
  3. Make Checkin of this folder

After this you will can Install the Nuget packages without receive TF400024 error.

Try:

  • Unbind all your projects from source control
  • Install the nuget package
  • Rebind all your projects again

A workaround for us was to check out the entire solution and then update your NuGet packages.

I had a similar issue and I did the following:

  1. Delete the file from my pc.
  2. Check in the change.

All:

If you check out code from TFS, and because the complex relationships between packages you cannot reload one or more nuget(s), here is what I did:

  1. Delete the whole solution folder.
  2. Check out code again.
  3. Right click on the solution, then click "Restore NuGet Packages"

But just make sure the code used to work properly before last time check in.

Thanks,

-Yuan Z

I had this same problem. The issue was that I had previously installed and uninstalled the package. Even though I checked the project into TFS after the installation, the package remained in the packages folder in my TFS solution.

In order to resolve, I opened the Source Control Explorer window and located the problem folder as identified in the package installation error message: "The change on \packages[folder][package].nupkg cannot be undone because a file already exists at \packages[folder][package].nupkg. The file must be deleted from disk for the undo to succeed."

I then deleted \packages[folder] and checked in.

After this, my NuGet package installed without issue.

Clearing your nuget cache before updating the packages could solve the problem.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!