Sunday, February 07, 2010

Unblock

Windows 7 is pretty security-conscious. I downloaded the latest Rhino.Mocks zip, extracted the .dll and .xml, referenced them into a new Visual Studio test project, and CTRL+R,CTRL+T'd to run the test. Fail! Test run deployment issue: 'Rhino.Mocks.dll' is not trusted.

Unbeknownst to me, there's a new option in Windows 7 (visible from the file's properties window) "this file came from another computer and might be blocked to help protect this computer." Smart. And there's an unblock button nearby. Click it.

It doesn't end there. I extracted the .xml file too, so that I'd have access to the Intellisense code documentation comments. This file needs to be unblocked too. Even if you've unblocked the .dll, the error message will persist: 'Rhino.Mocks.dll' is not trusted. Lies lies lies. Repeat step 1 to unblock the .xml.

Finally, Visual Studio will likely be working with cached assemblies, so the original .dll and .xml that were copied into the bin directory before the intial test run deployment failure are probably still there (they're still blocked). Delete them and let Visual Studio pick up the fresh unblocked files, and you'll be on your way again in no time.

No comments: