简体   繁体   English

TFS单元测试在开发人员计算机上通过但在构建计算机上失败

[英]TFS unit tests passing on developer machine but failing on build machine

I have some unit tests that are passing on developer machine but failing on TFS build machine. 我有一些在开发人员计算机上通过但在TFS生成计算机上失败的单元测试。 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. 但我可以查看放置文件夹,看看部署了哪些DLL文件等。

Also I see that pdb files were deployed on the build machine. 另外,我看到pdb文件已部署在构建计算机上。

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... 是的,您可以在构建机器上附加该进程...但是您必须登录到构建机器,并在服务器上运行VS实例,并具有管理权限才能附加到该线程...

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. 尝试使用批处理文件运行msbuild,然后可以在控制台中查看整个过程的进度。 Here is some starter code for ya: 这是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. 无论我有大写字母的地方都替换为您的设置...。保存.bat文件,双击,您可以在控制台中跟踪所有内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM