Jenkins引发的未知汇编错误

问题描述:

我有一个使用实体框架在vb.net中编码的单元测试项目。当我在Visual Studio上运行我的单元测试时,一切运行良好。当我尝试在jenkins上部署我的单元测试时,出现以下错误。Jenkins引发的未知汇编错误

Run has the following issue(s): 
Warning: Test Run deployment issue: The assembly or module 'Microsoft.Practices.ServiceLocation' directly or indirectly referenced by the test container 'C:\Program Files\Jenkins\workspace\upstreambatchtests\bin\debug\upstreambatchtests.dll' was not found. 

我不知道这microsoft.practices.servicelocation是什么,因为我的应用程序没有引用它。欣赏是否有人可以阐明它。

下面是我的詹金斯配置

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe" /testcontainer:MessageManagementLayer\UpstreamBatch\UpstreamBatchTests\bin\Debug\UpstreamBatchTests.dll /test:UpstreamBatchTests /resultsfile:UpstreamBatchTestsResults.trx 

未在测试中使用的组件将不会被复制到测试文件夹中。所以,你有两个选择

  1. 一个装饰添加到您的测试方法[DeploymentItem("MissingDll.dll")]其中MissingDll是编译器请求您的DLL。

  2. 安装DLL文件在你的机器的GAC代码 在你的情况下运行

在缺少DLL是Microsoft.Practices.ServiceLocation.dll

所以你的装饰应该是[DeploymentItem("Microsoft.Practices.ServiceLocation.dll")]

+0

喜faby,感谢您的回答,但仅仅为了澄清一下,为什么需要microsoft.practices.servicelocation.dll – 2014-12-02 09:32:34

+0

,因为您可能在项目中有一个参考,但当您创建单元测试时,它也不包含此参考 – faby 2014-12-02 09:39:29

+0

您是否尝试过我的解决方案?它对你有帮助吗? – faby 2014-12-02 10:17:06