3

I created a build pipeline for a C# project.

I referenced different nuget packages like Entity Framework and some own packages that are located in a feed.

Local the whole solution is building and running without problems.

Also in the build pipeline the nuget restore is working. But the build is failing because it cant find the nuget packages.

This is happening with public packages like Entity Framework and also with the packages from my feet.

The nuget Version:

  • Detected NuGet version 4.1.0.2450 / 4.1.0

I played around with build versions, build agents or created my own nuget.config file.

I also uninstalled nuget package, removed all references and reinstalled every package

For example:

##[error]paybla.Repository.EntityFramework\RepositoryBase.cs(3,19): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
RepositoryBase.cs(3,19): error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(3,19): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
UnitOfWorkBase.cs(3,19): error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(4,19): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
UnitOfWorkBase.cs(4,19): error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(5,19): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
UnitOfWorkBase.cs(5,19): error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(6,19): Error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
UnitOfWorkBase.cs(6,19): error CS0234: The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\RepositoryBase.cs(11,26): Error CS0246: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)
RepositoryBase.cs(11,26): error CS0246: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(15,26): Error CS0246: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)
UnitOfWorkBase.cs(15,26): error CS0246: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
##[error]paybla.Repository.EntityFramework\UnitOfWorkBase.cs(157,19): Error CS0246: The type or namespace name 'IDbSet<>' could not be found (are you missing a using directive or an assembly reference?)
UnitOfWorkBase.cs(157,19): error CS0246: The type or namespace name 'IDbSet<>' could not be found (are you missing a using directive or an assembly reference?) [d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj]
Done Building Project "d:\a\3\s\paybla.Repository.EntityFramework\paybla.Repository.EntityFramework.csproj" (default targets) -- FAILED.
4
  • Also in the build pipeline the nuget restore is working -- Is it working, or is it succeeding? Those two things aren't the same thing; a build activity can succeed even if it doesn't do what you're expecting it to do. Look at the restore log. Is it restoring all of the packages? Are there any warnings? Commented Jun 16, 2019 at 21:11
  • This is a very good answer! in fact i dont see any restored packages in the log. I dont know why i did not noticed this.. A link to the configuration: und-dann-los.de/wp-content/uploads/2019/06/Unbenannt.png End of the log says: All packages listed in packages.config are already installed. Im honest.. i dont have an idea what is the problem here Commented Jun 16, 2019 at 21:22
  • Use your own build agent to reproduce the issue, and then you can go to the actual working directory to analyze further. It is too broad to discuss such over the internet. Commented Jun 17, 2019 at 2:17
  • Are you using Nuget Restore or dotnet restore ? Commented Jun 17, 2019 at 7:09

2 Answers 2

1

Please try to check if you have add the \packages folder into the source control, if yes, you could removed the entire packages folder from the source control to see if it works to resolve the issue.

Sign up to request clarification or add additional context in comments.

Comments

0

Possibly unrelated to your case, but sometimes (in particular, when allowing R# to reference missing package) csproj file may contain reference to assembly on local drive - something like this

<ItemGroup>
  <Reference Include="name">
    <HintPath>../../your/local/path</HintPath>
  </Reference>
</ItemGroup>

Removing all such nodes and manually adding packages via nuget ui helped in my case

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.