Unit test project cannot find assembly under test (or dependencies)

After checking out some additional search results I came across this question here at SA Private Accessor for method is not found .

After I deleted the *.accessor file, my test project stopped complaining and compiled succesfully.

Everybody thanks for their help!


I tried all above to no avail. Finally, in the csproj i changed

<Private>False</Private>

to

<Private>True</Private>

on the references and all tests passed.


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.


There is a common error about executing unit tests : the execution folder.

Are you sure your unit test is running in the correct folder ? Not in the famous obj folder ?

In the obj folder, only generated assemblies are copied, not dependencies -even copy local true-. So if your test is launched from this folder, all the dependencies will missing.