.net – Unit test project cannot find assembly under test (or dependencies)

compiler-errorsnetunit testingvisual studiovisual studio 2010

When I try to run my Unit Test project, I get the following error:

Could not load file or assembly 'ASSEMBLY_NAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

The system cannot find the file specified.

The assembly under test is located in the same solution and every project target .NET 4.0 framework.
It worked for a while, but today I got this error again.
I can't figure out what is wrong, because the error message doesn't tell me enough. (like; WHICH file could not be found..)

I've tried to add a new Test project, but also that one worked for a while before it gave me this same error message.

Is there anybody who can point me in the right direction?

Edit: In the diagnostic build log, the following error appears:

C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\TeamTest\
Microsoft.TeamTest.targets(14,5): 
error : Could not load file or assembly 'ASSEMBLY_NAME, Version=1.0.0.0, 
Culture=neutral, PublicKeyToken=null' or one of its dependencies. 
The system cannot find the file specified.

Done executing task "BuildShadowTask" -- FAILED. (TaskId:671)

Done building target "ResolveTestReferences" in 
      project "ASSEMBLY_NAME.Tests.vbproj" -- FAILED.: (TargetId:985)

Best Answer

Check Build->Configuration Manager... menu. All projects should have the same platform and column Build checked.

Also you can take a look into output of the build (Output window), it usually states more clearly which file could not be found.