0
votes

I'm trying to get continuous integration to work for my solution using Team Services. My solution builds locally with no issues. The build process fails on Nuget Install:

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

Path to solution or packages.config is set to the SLN FILE NAME (boilerplate.sln) Installation type is set to INSTALL

I do not want to set the path to the package.config because I have multiple projects in this solution.

If I set the install type to RESTORE, the Nuget Restore Task passes, but the build solution fails with a bunch of warnings and errors:

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

I simply do not understand something about how this process works, please help I'm new to this.

My folder structure looks like this:

BoilerPlate.sln
packages
src
src\db
src\DB\BoilerPlate.Data.Context\
src\DB\BoilerPlate.Data.Context\package.config
src\DB\BoilerPlate.Data.Entities\
2
"Restore" is what you're looking for. It looks like Entity Framework may not be installed in the Global Assembly Cache on the build server. Check whether EntityFramework is installed as a NuGet package in your solution.jessehouwing
@jessehouwing Entity is installed as a NuGet package.Jim Kiely
But it looks to be loaded from the GAC, otherwise the error message would show the path to where it expects the assembly to be. Can you check the <reference element in the project file to see if it has a hintpath that points to the packages directory?jessehouwing
@jessehouwing the reference EntityFramework's path is set to my package folder in my repo.Jim Kiely
<HintPath>..\..\..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>Jim Kiely

2 Answers

0
votes

I removed the "packages" from the repository and then ran the build in Team Services and that solved the problem. Put "packages" directory in gitignore if you are using the "restore".

0
votes

I just had this error today. I fixed this error by reviewing the changes in my solution file with our base code branch and found some old lines that weren't supposed to be there. I think they were a result of a bad merge and should have been removed during a conflict resolve.

To fix the issue I simply removed the references that were old and everything built just fine.

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}

Also see this older thread on the same subject: Cannot restore nuget packages on VSTS (Packages failed to install)

Thanks, Fissh