简体   繁体   English

Visual Studio + nuget + TFS:检查nuget包?

[英]Visual Studio + nuget + TFS: checking in nuget packages?

I'm working on a TFS project with a small team. 我正在与一个小团队合作开展TFS项目。 This project has a bunch of nuget packages installed, but it's for a 4.0 project, and the nuget package manager GUI doesn't even offer the older versions of the packages any longer since their 4.5 equivalents are now being used. 这个项目安装了一堆nuget软件包,但它适用于4.0项目,而nuget软件包管理器GUI甚至不再提供旧版本的软件包,因为现在使用的是4.5个版本。 In order to allow other team members to compile the project, they need to have the exact versions of the packages. 为了允许其他团队成员编译项目,他们需要拥有包的确切版本。 I'd like to check in the entire "packages" folder used by nuget. 我想检查nuget使用的整个“packages”文件夹。 Is this a good idea? 这是一个好主意吗? If so, how does one check in the "packages" folder and all its contents since it exists at the solution level? 如果是这样,那么如何检查“packages”文件夹及其所有内容,因为它存在于解决方案级别? There is no "Include in Solution" option in Visual Studio as there is when you right-click an assembly. Visual Studio中没有“包含在解决方案中”选项,因为右键单击装配时。

We use an on-prem TFS install with no internet access so we have to check in our package folders or our builds fail. 我们使用本地TFS安装,没有互联网访问,所以我们必须检查我们的包文件夹或我们的构建失败。 The biggest issue is that VS does not behave consistently when it comes to adding the pending changes for new package files, often times it will ignore the .dll files in the pending changes window, sometimes it adds everything fine. 最大的问题是,在为新的包文件添加挂起的更改时,VS的行为不一致,通常会忽略挂起的更改窗口中的.dll文件,有时它会添加一切。

in the past I have also checked in the NuGet packages into version control. 在过去,我还检查了NuGet包中的版本控制。 With this some problems appeared: 有了这个问题就出现了:

  1. Some packages where not checked into version control when committing from Visual Studio into TFS. 从Visual Studio提交到TFS时未检入版本控制的某些包。
  2. Updating packages became a real problem. 更新包成为一个真正的问题。

For the first problem I had used the TFS Power Tools . 对于我使用TFS电动工具的第一个问题。 The problem with this solution is that every developer needed to install the Power Tools. 此解决方案的问题是每个开发人员都需要安装Power Tools。

A better solution came up with NuGet 2.7. NuGet 2.7提供了更好的解决方案。 It introduced package restore . 它介绍了包恢复 With package restore there's no need to check-in the packages folder. 使用包还原时,无需签入包文件夹。 They will be restored during build. 它们将在构建期间恢复。

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

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