VS2010亲不能够启动痣主机 [英] VS2010 pro not able to start Moles host

查看:148
本文介绍了VS2010亲不能够启动痣主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用的是痣框架(0.94.5)编写单元测试用例,但无法调试或运行测试用例。

We are using Moles framework (0.94.5) to write unit test cases but not able to either debug or run the test cases.

系统:Win7的64位

System: Win7 64bit

痣:0.94.5 64位与VS 2010 PRO

Moles: 0.94.5 64bit with VS 2010 pro

成功的解决方案生成。但是,试图运行测试用例我们得到了下面的错误。

The solution build successfully. But while trying to run test cases we are getting the following error.

{
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,以确定是否有在组装过程中加载任何错误。它给了两个错误的摩尔说

We also followed the fuslogvw to identify if there is any error during assembly loading. It gave two errors for Moles saying

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文件与。但无法得到它的工作。

We checked the configurations and everything seems ok. On one of the blog it was mentioned to remove the .exe.config file from privateassemblies folder under VS2010 IDE folder. But could not get it working.

上面我们得到了错误继后是摩尔寻找在那里的项目位于不同的驱动器项目的dll。

After following the above the error we got is moles looking for the project dll in a different drive from where project is located.

我们卸载后重新启动痣并安装痣重新启动机器,但无济于事。

after we uninstalled moles restarted and installed moles restarted the machine but to no avail.

找不到下发布这一正确的类别。

Could not find the right category under which to post this.

感谢

维斯

推荐答案

+1的研究已经完成。这是美联社preciated,将让你远在这里。

+1 for research already done. It's appreciated and will get you far here.

我可以添加以下内容:您有一个64位机和64位的痣。您还运行64位的测试?如果是这样,下面的解决了这个对我来说。如果没有,尝试也无妨。

I can add the following: You have a 64 bit machine and 64 bit moles. Are the tests you are running also 64 bit? If they are, the following solved this for me. If not, try it anyway.

  1. 编辑您的测试设置。 VS2010中,去考 - >编辑测试设置。从左侧菜单中选择主机。
  2. 选择选项运行测试的64位程序在64位机。
  3. 保存
  4. 现在,打开你的测试项目中的的AssemblyInfo.cs 文件。
  5. 在该文件的底部,添加以下行 [总成:MolesAssemblySettings(位数= MolesBitness.x64)]
  6. 在解决任何引用。
  1. Edit your test settings. IN VS2010, go to Test -> Edit Test Settings. Choose "Hosts" from the left side menu.
  2. Select the option "Run tests in 64 bit process on 64 bit machine".
  3. Save
  4. Now open the AssemblyInfo.cs file in your test project.
  5. At the bottom of the file, add the following line [assembly: MolesAssemblySettings(Bitness = MolesBitness.x64)]
  6. Resolve any references.

这是所有我需要的。

这篇关于VS2010亲不能够启动痣主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆