2017-07-05 45 views
0

我有一个在Visual Studio中制作的“旧”XAML构建定义;其中构建了一个解决方案并执行了单元测试。 现在我试着在新的TFS 2015网页中做出同样的事情。 我在Visual Studio Test之后创建了一个构建任务。TFS2015 Visual Studio测试:无法加载文件或程序集

但现在测试任务退出代码1并给了我很多 “System.IO.FileNotFoundException:无法加载文件或程序集”错误。 也“警告:MSTestAdapter未能及时发现在课堂上测试...”

所有DLL是他们必须是,新的定义有一个像旧相同的目录结构,但测试任务说有缺失的组件。

任何想法?

更新: 没有,我仍然有同样的错误消息:

Warning: Unable to load types from the test source 'J:\xyz-Tests.dll'. Some or all of the tests in this source may not be discovered. If you are running unit tests for Windows Store apps and referencing custom WinMD type then please visit http://go.microsoft.com/fwlink/?LinkId=238340 for more info. Error details: System.IO.FileNotFoundException: Could not load file or assembly 'xyz_Commons, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. 
System.IO.FileNotFoundException: Could not load file or assembly 'xyz_Processing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. 
System.IO.FileNotFoundException: Could not load file or assembly 'xyzCommons, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. 
+0

难道测试项目在Visual Studio 2013创建? –

+0

starain-MSFT,是的。 –

+0

尝试Andy的解决方案后,结果如何? –

回答

0

这应该正是被这个问题在下面的文章中提到,请尝试以下解决方法来解决这个问题:

Running Coded UI Tests built using Visual Studio 2013 with Team Foundation Server 2015

在这种情况下测试执行失败,因为测试执行 引擎无法在执行0123时解析旧版本二进制文件在14.0环境下测试(TFS 2015)。

因此,您需要使用测试项目配置文件中的程序集绑定来更新项目以引用新版本的程序集(在此方案中为VS 2015)。

作为解决办法这个问题,添加一个“的app.config”文件到您的 溶液(了解如何添加的app.config https://msdn.microsoft.com/en-in/library/ms184658.aspx),并与共享上的更新文件的内容 OneDrive。更新后的 配置文件包含从12.0版到14.0的程序集重定向,这将确保测试代理机器能够解析框架程序集。将更新后的配置文件 注册到源代码管理存储库并再次运行一次 的BDT方案。这次测试应该运行良好。如果测试执行 再次为其他某个 程序集引发抱怨版本不匹配错误,请将程序集添加到app.config文件并重试。

您也可以参考这篇文章: http://www.dotnetcatch.com/2015/10/01/tfs-2010-to-2015-upgrade-codedui-feature-test-builds/

+0

@Chris Roeder您是否通过上述解决方法解决了您的问题? –

+0

不,我仍然有相同的错误消息: –

+0

@ChrisRoeder PublicKeyToken = null告诉你CLR正在查找未签名的程序集。既然你签了他们,那不太好,这个kaboom是预料之中的。 您将不得不重建程序,以便它使用更新的签名程序集并将非空的PublicKeyToken嵌入到清单中。您可能需要删除现有的程序集引用并将其添加回来,但是从您是否使用无符号副本构建程序的问题不清楚。 如果仍有问题,请使用Fuslogvw.exe实用程序。 –

相关问题