-2

I'm having an issue with Teamcity. While running a build of my project in Visual Studio being passed successfully, running this "build" in Teamcity results with some errors difficult to understand.

These are the errors I'm getting from TeamCity:

AppealPersonDetails.cs(29, 7): error CS0246: The type or namespace name 'Tlv' could not be found (are you missing a using directive or an assembly reference?) 
AppealPersonDetails.cs(32, 7): error CS0246: The type or namespace name 'Excel' could not be found (are you missing a using directive or an assembly reference?) 
AppealReportAddAnotherApplication.cs(29, 7): error CS0246: The type or namespace name 'Tlv' could not be found (are you missing a using directive or an assembly reference?) 
AppealReportDetailsPage.cs(29, 7): error CS0246: The type or namespace name 'Tlv' could not be found (are you missing a using directive or an assembly reference?) 
FinishProcessPage.cs(29, 7): error CS0246: The type or namespace name 'Tlv' could not be found (are you missing a using directive or an assembly reference?) 
MainStatusPage.cs(29, 7): error CS0246: The type or namespace name 'Tlv' could not be found (are you missing a using directive or an assembly reference?) 
MainTestRunner.cs(27, 7): error CS0246: The type or namespace name 'Tlv' could not be found (are you missing a using directive or an assembly reference?) 
MainTestRunner.cs(31, 7): error CS0246: The type or namespace name 'Excel' could not be found (are you missing a using directive or an assembly reference?) 
Queries.cs(13, 7): error CS0246: The type or namespace name 'Tlv' could not be found (are you missing a using directive or an assembly reference?) 
StatusApplicationsPage.cs(29, 7): error CS0246: The type or namespace name 'Tlv' could not be found (are you missing a using directive or an assembly reference?) 
StatusPage.cs(29, 7): error CS0246: The type or namespace name 'Tlv' could not be found (are you missing a using directive or an assembly reference?)
Manfred Radlwimmer
  • 13,257
  • 13
  • 53
  • 62
JumpIntoTheWater
  • 1,306
  • 2
  • 19
  • 46

1 Answers1

2

Any third party dependencies that would be in the GAC on your machine will need to be in the GAC or locally locatable on your build server.

I would check the location of the assemblies that contain the Tlv and Excel namespaces and go from there. If the Excel namespace is due to depending on the Office Interop Assemblies, you will need the correct version of Excel installed on the build server.

Edit based on comments:

OP clarified that he was using references to the assemblies directly rather than project references. When he switched to using project references, the build order was correctly established and his problem was solved.

toadflakz
  • 7,764
  • 1
  • 27
  • 40
  • what do you mean by saying "location of assemblies that contain the Tlv and Excel namespaces"? Both assemblies are actually projects created by me. all of my projects were uploaded to TFS(source control). first, they was cretaed locally, uploaded to TFS and then I did get latest on the VM machine where the TeamCity is currently running on. – JumpIntoTheWater Jan 19 '17 at 15:28
  • If they are project dependencies, have you ensured that the build order correctly builds them before the assembly you are trying to build with? Are you referencing them as projects or only the compiled assembly? – toadflakz Jan 19 '17 at 15:41
  • I am referencing them as a compiled assemblies(just adding the dll as reference). but I think the problem is somewhere there. I'll just need to findout what leads to the error. I have already loaded Tlv and Excel assemblies and built them , so I need to get deeper in order to findout what caused it. I'll update as soon as I'll find out.10x – JumpIntoTheWater Jan 19 '17 at 18:44
  • You should run the whole process as a single build and rather use project references than referencing the binaries. The artifacts are not typically shareable between build profiles on TeamCity afaik. If you are referencing them as DLLs, you need to make sure that the location is relative to your source code and probably with the binary checked into your CVS (not ideal) i.e. a lib folder with the assembly DLL already in it before the build is run. – toadflakz Jan 20 '17 at 10:07
  • Thanks, you were right. My problem was using the DLL's instead of as a project reference. 10x! Please please post it as answer and I will mark it as one. – JumpIntoTheWater Jan 20 '17 at 10:28
  • Done. ;) Glad I could help! – toadflakz Jan 20 '17 at 10:33