The specified module 'DistributedCacheAdministration' was not loaded because no valid module file wa

在执行System.Management.Automation.Runspaces.Runspace.Open方法时,可能 会报需要加载的模块‘DistributedCacheAdministration’不能被加载,这个问题困扰我快两天了,今天终于在MSDN的blog上看到一个解决办法。灰常感谢呀。解决办法如下:


What to do if you get this error when unit testing Windows Server AppFabric Caching

Being new to unit testing code that invokes PowerShell I ran into this problem when trying to test code that was using the Windows Server AppFabric Caching cmdlets.

System.Management.Automation.Runspaces.RunspaceOpenModuleLoadException was unhandled by user code
  Message=One or more errors occurred processing the module 'DistributedCacheAdministration' specified in the InitialSessionState object used to create this runspace. See the ErrorRecords property for a complete list of errors. The first error was: The specified module 'DistributedCacheAdministration' was not loaded because no valid module file was found in any module directory.
  Source=System.Management.Automation
  WasThrownFromThrowStatement=false


I borrowed some code from Stephen Kaufman’s blog to create a cache in my unit test.  But when I ran it I got the exception above.  This is happening because the Visual Studio Unit Test tool by default runs tests in a 32 bit process on my x64 machine.

What I need to do is to force Visual Studio to run the tests in an x64 process.  You can do this by altering the local.testsettings file in your solution items.

Step 1 – Open the local.testsettings file

image

Step 2 – Set the Hosts to run in 64 bit

image

Note: The default is to force the tests to run in 32 bit processes.我的默认是32位,但机器是64位的,所以……

原文链接:http://blogs.msdn.com/b/rjacobs/archive/2010/05/04/the-specified-module-distributedcacheadministration-was-not-loaded-because-no-valid-module-file-was-found-in-any-module-directory.aspx

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值