Helen
Helen

Reputation: 65

Is it possible to remote debug unit tests on the build server using Visual Studio

When unit tests are failing on the build server but not locally on my computer I would like to debug the code to find the problem. The build server runs Team City.

Upvotes: 0

Views: 679

Answers (1)

Toso Pankovski
Toso Pankovski

Reputation: 37

Here is one possible solution I used:
1. Within your test c#/vb code file, create a log file that would trace whatever you want to trace/print from the test you would debug. One possible location of that log file could be: %system.teamcity.build.checkoutDir%\LOG.TXT
2. After the test build step, create a PowerShell script that will copy the trace/log file onto a shared folder, that could be a shared folder on your machine (do not forget to give write/modify permissions to the build server user account on the share and folder security). If you don't know the builder user account, grant write/modify permissions to Everyone on that share (alert: this is unsafe from a security standpoint). Here is how that copy command could look like: copy -Force %system.teamcity.build.checkoutDir%\LOG.TXT \MyMachineName\LogUnitTestsShare

Upvotes: 1

Related Questions