I ran across an interesting problem today when I downloaded NMock to assist with some unit testing in Visual Studio. Suffice to say that when I referenced the NMock assemblies, compiled and attempted to run the tests, the test manager simply aborted with the following error:
"Failed to Queue Test Run... [because]... the location of the file 'NMock2.dll' is not trusted."
This error seemed pretty strange to me because the assembly wasn't located on a network share but simply on my local machine. The location on disk should be trusted, right?
I located NMock2.dll on disk, opened the file properties dialogue and noticed the following at the bottom of the general tab:
So Windows Vista detected that I had downloaded the NMock DLLs from the Internet in a zip archive. When I extracted the assemblies, Windows marked the assemblies as un-trusted code.
Anyway, if you experience this issue, simply click the Unblock button and the assembly will become trusted. You may need to restart Visual Studio before the tests will run.