简体   繁体   English

TFS在线构建不带提要的私有软件包的还原

[英]TFS Online Build restore of private package without feed

I have a nuget package which lives on a SMB Share/Network drive within our company. 我有一个nuget软件包,该软件包位于我们公司的SMB共享/网络驱动器上。 This package has been included in project which is using TFS Online for source control. 该软件包已包含在使用TFS Online进行源代码控制的项目中。 We are now trying to use TFS Build however it is failing stating it can't find namespace. 现在,我们正在尝试使用TFS Build,但是它未能说明找不到命名空间。

Contracts\\IService.cs (7): The type or namespace name 'Project1' could not be found (are you missing a using directive or an assembly reference?) Contracts \\ IService.cs(7):找不到类型或名称空间名称“ Project1”(是否缺少using指令或程序集引用?)

I am aware that checking in packages into TFS is not a good idea however I can't create a private NuGet feed. 我知道将软件包检入TFS不是一个好主意,但是我无法创建私有的NuGet feed。 The package causing the error is checked-in in the default packages folder, however I am led to believe that the build just ignores these and restores by default. 导致错误的程序包已在默认程序包文件夹中签入,但是我被认为是该构建仅忽略这些程序并默认还原。

I am using the AzureContinousDeployment.11.xaml process with VS 2103 update 4. After build I want the site to be deployed to a deployment slot on azure websites. 我正在将AzureContinousDeployment.11.xaml进程与VS 2103更新4一起使用。构建后,我希望将站点部署到Azure网站上的部署插槽。

Is there away to tell the build server to use just the provided packages and not restore? 有没有办法告诉构建服务器只使用提供的软件包而不还原?

As you can't create a private NuGet feed, putting packages in TFS Version Control is an option (I agree it is not a good idea, because TFS Version Control is mainly used to put source code, not build output files). 由于您无法创建私有的NuGet提要,因此可以选择将软件包放入TFS版本控制中(我同意这不是一个好主意,因为TFS版本控制主要用于放置源代码,而不是生成输出文件)。

After the package is added to source control, you need to modify the path used to add reference. 将程序包添加到源代码管理后,您需要修改用于添加引用的路径。

For example, there is one folder called Packages under your project which contains you NuGet packages, and the Packages folder is added to TFS Version Control as well. 例如,在您的项目下有一个名为Packages的文件夹,其中包含NuGet软件包,并且Packages文件夹也添加到TFS版本控制中。 Then you need to modify the .proj to target to the path which is similar to: 然后,您需要修改.proj以定位到类似于以下内容的路径:

 <Reference Include="Project1">
  <HintPath>..\packages\Project1.dll</HintPath>
  <Private>True</Private>
</Reference>

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

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