I've got a problem with some C# unit tests that work find in Visual Studio, but fail in TeamCity.
The problem is because a common part to each test runs something like:
File.Copy(@"..\..\..\Build\data\Input\test1.out", executionPathUri.LocalPath + \\test1.out, true);
The "Build" directory is at the same level as the project directories.
When the tests run in Visual Studio, the working directory is "MyProj.UnitTests\bin\Debug", so "..\..\..\Build" is valid.
When they run in TeamCity, the working directory is "D:\TeamCity\BuildAgent1\work\dbf2c5274c7acb97", so "..\..\..\Build" is invalid (as it's above the checkout directory).
Is there a way around this? The MSTest build runner seems to be one of the few that does not allow the setting of an alternate working directory... why?