3
votes

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:

  • Set the copy local of the referenced DLLs to false and true again, as stated on some websites
  • Check the build definition if it cleans the workspace (it does)
  • Added assembly names to the objects in code. I.e.: PredifinedTemplate to Core.Infrastructure.Objects.PredefinedTemplate

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.

1

1 Answers

3
votes

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