The above suggestions did not work for me when doing unit tests - I did a clean one and rebuilt for the whole solution, but the DLL and PDB files were not deleted in the ~ \ UnitTests \ bin \ Debug directory, so I had to manually delete these files, then right-click in the UnitTests directory and select "Build".
Please note that in my case I am using Visual Studio 2013 with Update 3.
UPDATE:
The creation of a batch file for cleaning and building my solution has been completed, so that Visual Studio does not leave the project incorrectly without rebuilding them:
msbuild.exe "MyClassLibrary\MyClassLibrary.csproj" /t:Rebuild /p:Configuration=Debug msbuild.exe "UnitTests\UnitTests.csproj" /t:Rebuild /p:Configuration=Debug
Roger source share