2017-03-03 49 views
0

我正在尝试使用Team Services为我的解决方案获得持续集成。我的解决方案在本地生成,没有问题。构建过程上的NuGet失败安装:团队服务持续集成构建引用Nuget失败

Error: D:\a\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.29\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe failed with return code: 1 
Packages failed to install 

路径溶液或packages.config设置为 安装类型设置安装

我不想SLN的文件名(boilerplate.sln)将路径设置为package.config,因为我在此解决方案中有多个项目。

如果我设置安装类型进行还原,将的NuGet恢复任务通过,但在构建解决方案失败了一堆警告和错误的:

Warnings: (one of many but all similar) 
C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(1820,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. 

Errors: (one of many but all similar) 
src\DB\BoilerPlate.Data.Context\BoilerPlateContext.cs(3,23): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) 

我根本不明白一些关于如何处理工程,请帮助我对此感到陌生。

我的文件夹结构如下所示:

BoilerPlate.sln 
packages 
src 
src\db 
src\DB\BoilerPlate.Data.Context\ 
src\DB\BoilerPlate.Data.Context\package.config 
src\DB\BoilerPlate.Data.Entities\ 
+0

“恢复” 是你在找什么。它看起来像实体框架可能不安装在生成服务器上的全局程序集缓存中。检查EntityFramework是否作为解决方案中的NuGet包安装。 – jessehouwing

+0

@jessehouwing实体作为NuGet包安装。 –

+0

但是它看起来是从GAC中加载的,否则错误信息会显示它期望程序集所在的路径。你可以检查项目文件中的' jessehouwing

回答

0

我删除从资源库中的“包”,然后在团队服务跑了构建和解决的问题。如果您使用的是“还原”,请将“packages”目录放入gitignore中。

+0

你可以接受它作为答案。 –

0

我今天刚刚出现这个错误。我通过使用我们的基本代码分支查看解决方案文件中的更改来修复此错误,并发现一些不应该存在的旧行。我认为它们是不合并合并的结果,应该在冲突解决期间被删除。

要解决这个问题,我只是删除旧的引用和一切构建得很好。

Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{EAECFF2D-7339-4180-8E1E-6DF9EC9EB131}" 
EndProject 
{3C14F190-6B6A-4913-9681-AFD9B62850FA} = {EAECFF2D-7339-4180-8E1E-6DF9EC9EB131} 
{687ECE00-A567-40F3-BFF9-C3B639328F27} = {EAECFF2D-7339-4180-8E1E-6DF9EC9EB131} 

也看到关于同一主题的此旧主题:Cannot restore nuget packages on VSTS (Packages failed to install)

感谢, Fissh