Tamar
Tamar

Reputation: 2066

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

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. This is all set on a local vm while the source code is located on a shared folder from the host. I'm running ReSharper with VS and run the tests through it.

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. Any thoughts on this are welcomed :)

Thanks!

Upvotes: 2

Views: 1868

Answers (1)

Mark Seemann
Mark Seemann

Reputation: 233505

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.

If that doesn't help either, reboot your computer :)

If that doesn't help either, I'm out of ideas...

Upvotes: 1

Related Questions