2017-07-05 96 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實用程序。 –

相關問題