I have some unit tests that are passing on developer machine but failing on TFS build machine. These tests are failing for different reasons. I have very limited access to build machine. But I could look into the drop folder and see what DLL files were deployed etc.
Also I see that pdb files were deployed on the build machine.
Is there any way to debug and step through the code on why its only failing on build machine?
Is there any way to debug and step through the code on why its only
failing on build machine?
Yes you can attach to the process on the build machine... But you would have to be logged into the Build machine and have an instance of VS running on the server and have Admin rights to attach to the thread...
You could also do it if the admins were willing to open up the server to remote debugging. But since that opens up more of a security risk than just giving you access to the server it is unlikely that this option is viable either.
So for you no. You will need to look at what the failures are and figure out what would cause that to happen. Then you can try to fix that.
Try using a batch file to run msbuild, then you can view the progress of the whole process in the console. Here is some starter code for ya:
ECHO Starting Build
:: Change to MSBuild Directory
CD C:\Windows\Microsoft.NET\Framework\v4.0.30319
PAUSE
:: READY TO RUN?
ECHO READY TO RUN...
MSBuild.exe "C:\Users\PATH TO YOUR PROJECT HERE\.csproj" /t:MsDeployPublish /p:MsDeployServiceUrl=https://DOMAINHERE.com:8172/msdeploy.axd;DeployIisAppPath="IIS SITE NAME HERE";username=USERNAME;password=PASSWORD;AllowUntrustedCertificate=True;Configuration=Release
:: Outputs tons of network information into the command prompt
ECHO All done.
PAUSE
Wherever I have caps replace with your settings.... The save the .bat file, double click and you can trace everything in the console.