我们正在使用 Moles 框架 (0.94.5) 编写单元测试用例,但无法调试或运行测试用例。
系统:Win7 64位
痣:0.94.5 64bit with VS 2010 pro
解决方案构建成功。但是在尝试运行测试用例时,我们收到以下错误。
{
Error
9/6/2013 3:35:32 PM
System.InvalidOperationException : Could not start Moles host. Please review the Test Run Errors for more information. //error
at Microsoft.Moles.VsHost.Agent.HostTestAdapterDriver.EnsureHostAdapter()
at //error
Microsoft.Moles.VsHost.Agent.HostTestAdapterDriver.Microsoft.VisualStudio.TestTools.Execution.IBaseAdapter.Run(ITestElement testElement, ITestContext testContext)
at Microsoft.Moles.VsHost.Agent.MolesAgentAdapter.Run(ITestElement testElement, ITestContext testContext) //error
U0319VM2184
我们还按照 fuslogvw 来识别在程序集加载过程中是否有任何错误。它给了 Moles 说的两个错误
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Program Files\Microsoft Moles\bin\moles.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = NORD\x03g
LOG: DisplayName = Microsoft.Moles, Version=0.94.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Program Files/Microsoft Moles/bin/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = moles.exe
Calling assembly : moles, Version=0.94.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
}
===
LOG: Start binding of native image Microsoft.Moles, Version=0.94.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
WRN: No matching native image found.
我们检查了配置,一切似乎都很好。在其中一篇博客中提到要从 VS2010 IDE 文件夹下的 privateassemblies 文件夹中删除 .exe.config 文件。但无法让它工作。
在遵循上述错误之后,我们得到的错误是痣在与项目所在的不同驱动器中寻找项目 dll。
在我们卸载痣重新启动并安装痣后重新启动机器但无济于事。
找不到发布此内容的正确类别。
谢谢
维姬