【问题标题】:The assembly or module 'System.Data.SqlServerCe' was not found [duplicate]未找到程序集或模块“System.Data.SqlServerCe”[重复]
【发布时间】:2014-02-06 14:32:36
【问题描述】:

我在 Visual Studio 2012 中有一个自动化测试套件,使用 MsTest。

我可以使用 MsTest 和 Resharper 通过 Visual Studio 成功运行测试。

但是当我尝试通过命令提示符运行我的 MsTests 时,会返回以下错误:

Run has the following issue(s):
Warning: Test Run deployment issue: The assembly or module 'System.Data.SqlServerCe' directly or indirectly referenced by the test container 'c:\project.dll' was not found.

为了解决这个问题,我已经尝试过:

向我的项目添加 System.Data.SqlServerCe 引用。

设置参考设置 'Copy Local' = True

编辑了我的文件:vstest.executionengine.x86.exe

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <qualifyAssembly partialName="System.Data.SqlServerCe" fullName="System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    </assemblyBinding>

还编辑了我的 app.config 以包含与上述相同的 assemblyBinding。

这些都不起作用。因此,仅当我尝试通过命令提示符运行测试时才会看到此错误。

大家有什么想法吗?

【问题讨论】:

  • 如何从命令 promt 调用 MSTest?
  • (示例)C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE>mstest /testcontainer:C:\Project\Project.dll /test:TestOne

标签: mstest


【解决方案1】:

我将在这里回答我自己的问题:

原来上面的警告不是我的问题。当我回到 VS Resharper 设置并勾选 legacy 复选框时,我开始通过 CMD 收到与 Mstest 相同的错误。

但此视图中的错误消息更详细。基本上我必须将所有相关的 DLL(在本例中为 Ranorex)一一添加到 GAC,直到错误停止发生。

例如。 GAC 命令:

C:\Program Files (x86)\Microsoft Visual Studio 11.0>gacutil /i "C:\ThirdPartyTools\Ranorex\Ranorex.Core.dll"

【讨论】:

  • 您是否尝试在 mstest 设置 msdn link 中使用其他文件夹来发现依赖程序集?可能这可以解决您的问题,GAC 依赖程序集不是一个好主意。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-11-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多