user1140479
user1140479

Reputation:

TFS build fails, but Visual Studio works

I have made a new build definition. Most options are kept on default. I'm just playing around for the moment.

Problem is that when I build my projects as release mode in Visual Studio 2013 all is good, not errors. When TFS builds it I have a few errors:

(I had to translate it from my own language to English, sorry for that)

TemplateService.cs (80): Core.Infrastructure.Objects.PredefinedTemplate does not contain a definition for TemplateId and there is no extentionmethod TemplateId found gevonden *(something with first argument)* of the type Infrastructure.Objects.PredefinedTemplate is being accepted (possibly missing a user instruction or an assmbly-reference)

The things I already did:

Whatever I do, I keep gettings these errors! Does anyone know what is happening?

UPDATE:

As stated by James Reed I have placed the referenced projects in NuGet packages. In the end I had to place two projects in NuGet-packages. The build on TFS works now and it even deploys to the server.

Using NuGet is not my first choice, because of debugging functionality. But for these two projects, that only holds objects and data-entities, it should not be a problem.

Upvotes: 3

Views: 3617

Answers (1)

James Reed
James Reed

Reputation: 14052

You are missing an assembly reference. i.e. the dll containing the definition for TemplateId is not available on the build server.

If this is defined in a project in the same solution, then something is wrong with the project reference, try deleting and recreating the reference.

If this is a binary reference then you have 3 options

  1. Add the project to the solution and use a project reference.
  2. Check the binary in to source control (not recommended)
  3. Use nuget to manage your references

Upvotes: 3

Related Questions