Tree55Topz
Tree55Topz

Reputation: 1142

Getting Type or namespace could not be found error for build definition in TFS

So I may have messed up and undid a bunch of changes when first adding this project to source control.. Basically what is happening is this

I have my local version which builds fine, no errors at all. I am trying to create a build definition for it in TFS but I get the following errors

Error CS0246: The type or namespace name 'OpenQA' could not be found (are you missing a using directive or an assembly reference?)

I get these errors for NUnit, Selenium & Microsoft Interop. These are all the packages I installed using the package manager. Looking at the files in source control, under packages they are all there. However with this build definition it fails, and if I create a new workspace and pull it down fresh I see the exact same errors.

So obviously, I did some magic to make my main local workspace build correctly, but did not do something right when checking it into source control as whenever it is kicked off in a build definition or pulled down fresh I see these errors. Does anyone have any ideas as to how I can repair this?? I have already tried the following

  1. Restore NuGet Packages
  2. Uninstall all packages and install again. This did not work because it showed as no pending changes since it matches what is in source control.

Is there somewhere in the TFS build definition I need to configure this? Or, more likely, what to check in to repair the solution in source control.

Upvotes: 1

Views: 1136

Answers (1)

Eddie Chen - MSFT
Eddie Chen - MSFT

Reputation: 29966

Nuget packages should not go into Source Control. Delete the packages in the source control and add a nuget restore task in your build definition to restore the required packages during the build.

Upvotes: 1

Related Questions