简体   繁体   中英

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. This package has been included in project which is using TFS Online for source control. We are now trying to use TFS Build however it is failing stating it can't find namespace.

Contracts\\IService.cs (7): The type or namespace name 'Project1' could not be found (are you missing a using directive or an assembly reference?)

I am aware that checking in packages into TFS is not a good idea however I can't create a private 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.

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).

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. Then you need to modify the .proj to target to the path which is similar to:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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