Search code examples
c#visual-studioseleniumteamcityteamcity-9.0

TeamCity compilation error


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?)

Solution

  • 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.