3
votes

I have class library outside my solution directory, so I have reference like this in *.sln file "../SomeDependency.csproj" In VS everything is ok, but TeamCity failed when try to build my solution. I guess it copy all solution directory so relation doesn't exists any more.

This is error I had C:\TeamCity\buildAgent\work\799db5684a98650b\blablabla.sln.metaproj error MSB3202: The project file "C:\TeamCity\buildAgent\work\799db5684a98650b....\Shared\Libraries\mysecretlib‌​rary\mysecretlibrary.csproj" was not found.

1
Using TFS for source control?Joachim Isaksson
mercurial source controlBohdan
error that this library not foundBohdan
C:\TeamCity\buildAgent\work\799db5684a98650b\blablabla.sln.metaproj error MSB3202: The project file "C:\TeamCity\buildAgent\work\799db5684a98650b\..\..\Shared\Libraries\mysecretlibrary\mysecretlibrary.csproj" was not found.Bohdan

1 Answers

2
votes

The class library outside your solution produces either an executable or dll, most likely a dll. When working with TeamCity, this dll is what you should be referencing in your project, rather than the external project itself.

If you are happy for the external library to build on your TeamCity Build Agents, add another Build Configuration to build the solution and post it as an artifact, you can then add a reference to your project to download this artifact into a known location and reference it directly. (for TeamCity build you can set it as an artifact dependency in the build configuration, for local builds I suggest you look into ways you can provide the external assembly automatically, I have not used Mercurial)

If this isn't going to work for you, your other option is to incorporate this library into the solution. Only do this if this is the only place the library is used! I am not advocating copying projects around your solutions, if its used in multiple locations then you need to provide it in a compatible way, as an artifact reference in TeamCity, and however best you find to provide the assembly for your local builds.