[英]FileLoadException when running unit tests in visual studio
I'm trying to run some unit tests in VS 2005 and keep getting the following error 我试图在VS 2005中运行一些单元测试,并不断收到以下错误
System.IO.FileLoadException: Could not load file or assembly
'Tests.CS.vs2005, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, ref StackCrawlMark stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, ref StackCrawlMark stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, ref StackCrawlMark stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at JetBrains.ReSharper.UnitTestProvider.nUnit.NUnitTaskRunner.GetType(IRemoteTaskServer server, RemoteTask fixture, String assemblyLocation, String typeName)
in c:\Agent\work\e1023618541fdc56\src\UnitTestProvider.nUnit\src\NUnitTaskRunner.cs: line 539
at JetBrains.ReSharper.UnitTestProvider.nUnit.NUnitTaskRunner.Start(IRemoteTaskServer server, TaskExecutionNode node, NUnitTestFixtureTask fixture)
in c:\Agent\work\e1023618541fdc56\src\UnitTestProvider.nUnit\src\NUnitTaskRunner.cs: line 353
at JetBrains.ReSharper.UnitTestProvider.nUnit.NUnitTaskRunner.Start(TaskExecutionNode node)
in c:\Agent\work\e1023618541fdc56\src\UnitTestProvider.nUnit\src\NUnitTaskRunner.cs: line 26
at JetBrains.ReSharper.TaskRunnerFramework.CurrentAppDomainHost.Execute(TaskExecutionNode node)
in c:\Agent\work\e1023618541fdc56\src\TaskRunnerFramework\src\Impl\CurrentAppDomainHost.cs: line 86
The assembly Tests.CS.vs2005 is the unit test's assembly from which the code is run. 程序集Tests.CS.vs2005是从中运行代码的单元测试程序集。 This is all set on a local vm while the source code is located on a shared folder from the host. 当源代码位于主机的共享文件夹中时,所有这些都在本地vm上设置。 I'm running ReSharper with VS and run the tests through it. 我正在使用VS运行ReSharper,并通过它运行测试。
Has anyone encountered this? 有人遇到过这个吗? I'm trying to find the config file that's suppose to contain the reference Tests.CS.vs2005, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null , my guess is this is a reference error related to the path to the host machine. 我正在尝试查找假定包含参考Tests.CS.vs2005,Version = 0.0.0.0,Culture = neutral,PublicKeyToken = null的配置文件,我猜这是与主机路径相关的参考错误机。 Any thoughts on this are welcomed :) 欢迎对此有任何想法:)
Thanks! 谢谢!
If this is the type of error I think it is, it is usually caused by the previously built versions of the assembly files are locked by another process. 如果这是我认为的错误类型,则通常是由于先前构建的程序集文件版本被另一个进程锁定而引起的。 Try shutting down your other applications and see if it doesn't help. 尝试关闭其他应用程序,看看是否有帮助。 If you do it systematically, you should be able to figure out which one was the culprit. 如果系统地执行此操作,则应该能够找出是哪一个是罪魁祸首。
If that doesn't help, restart Visual Studio. 如果那没有帮助,请重新启动Visual Studio。
If that doesn't help either, reboot your computer :) 如果仍然不能解决问题,请重新启动计算机:)
If that doesn't help either, I'm out of ideas... 如果那也无济于事,我就没主意了...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.