简体   繁体   English

Nuget软件包未在TFS Build上解压缩

[英]Nuget package not extracted on TFS Build

I am trying to set up automated builds in TFS2015. 我正在尝试在TFS2015中设置自动化版本。 The goal is to have solutions automatically build and tested when checked in and if everything passes then a new Nuget package is created and placed in a local repository. 目标是让解决方案在签入时自动构建和测试,如果一切顺利,则将创建一个新的Nuget包并将其放置在本地存储库中。

This process works fine for my first solution which is a simple project with no dependencies. 对于我的第一个解决方案来说,此过程可以正常工作,这是一个没有依赖性的简单项目。 The Nuget package that is created from this project is then used by a second project as a dependency. 然后,从该项目创建的Nuget包将被另一个项目用作依赖项。

This works fine when building in Visual Studio. 在Visual Studio中构建时,此方法工作正常。 The package is downloaded and extracted as normal. 正常下载并提取该软件包。 However when I check this second project in to TFS the automated build does not handle this package properly. 但是,当我将第二个项目签入TFS时,自动构建无法正确处理此包。 The package is restored from the local repository but it is not extracted. 该软件包是从本地存储库中还原的,但未提取。 This means that the build fails as it cannot find the actual DLL that it requires. 这意味着生成失败,因为它找不到所需的实际DLL。

I am also using EntityFramework in the project and it works correctly. 我也在项目中使用EntityFramework,它可以正常工作。 The package is downloaded but then it is also extracted. 该软件包已下载,但随后也被解压缩。

I have tried the workaround given in this question but the TFS server does not have a C:\\Users.nuget\\packages folder. 我已经尝试过此问题中给出的解决方法,但是TFS服务器没有C:\\ Users.nuget \\ packages文件夹。

I've also tried to clear the Nuget cache using the command here but again that didn't help. 我也尝试使用此处的命令清除Nuget缓存但同样没有帮助。

If I manually extract the Nuget package that gets downloaded by the automated build and then run the build again it works which suggests that the issue isn't with the package itself? 如果我手动提取由自动版本下载的Nuget程序包,然后再次运行该程序,它将起作用,这表明问题不在于程序包本身吗?

Nuget.exe version is 3.5. Nuget.exe的版本是3.5。 .Net version is 4.5 standard. .Net版本是4.5标准。 Packages are referenced in packages.config and also by project reference. 软件包在packages.config中引用,也由项目引用。 Nuget.exe is being used for the restore. Nuget.exe用于还原。

Any idea on why the local package is not being extracted? 关于为什么不提取本地软件包的任何想法?

The cause of this turned out to be that I had accidentally checked in the packages folder in this project as some point so what appeared to be coming from my local Nuget folder was actually just being copied out of the packages folder in the project. 造成这种情况的原因是,我在某个项目中不小心检查了packages文件夹,因此实际上是从本地Nuget文件夹中获取的内容实际上只是从项目的packages文件夹中复制出来的。

Removing the packages folder from TFS resolved the issue. 从TFS删除程序包文件夹可解决此问题。

Still not sure why it didn't extract the package in any case but problem solved. 仍然不确定为什么它在任何情况下都不会提取包,但是问题已解决。

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

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