Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS Build fails with: The type or namespace name 'Practices' does not exist in the namespace 'Microsoft'

I have a web api project that is working fine in my local machine. After I pushed it to GIT on Visual Studio Team Services, created a build definition (with Restore NuGet packages enabled) and queued a build, i get the below error:

The type or namespace name 'Practices' does not exist in the namespace 'Microsoft' (Are you missing assembly reference?)

I have tried building with "Keep Local" property both true and false & "Specific version" property both true and false for the CommonLibrary references. Any combination for these two properties is resulting in the same.

like image 692
Aparna Avatar asked Feb 18 '16 07:02

Aparna


3 Answers

I had a similar problem with VSO build and Azure packages: enter image description here

The problem was solved by reinstalling the packages for the projects.

In the Package Manager Console:

Update-Package -Reinstall
like image 85
maximpa Avatar answered Oct 28 '22 23:10

maximpa


This is how i resolved it. I made sure that the same libraries referred in packages.config file in all five projects of the solution have same version number. (In most cases, i re-installed from NuGet manager). In the Git branch, i deleted the packages folder so that the libraries are restored afresh. That did the trick. The build passed the next time.

like image 43
Aparna Avatar answered Oct 29 '22 01:10

Aparna


I had exactly the same symptoms, but in my case it turns out that although I could see the package listed under 'References' for my .Web project and all ran OK locally it wasn't actually installed.

Is it installed or not?

Installing the package via the NuGet UI worked for me.

like image 35
Mike Rouse Avatar answered Oct 29 '22 00:10

Mike Rouse