RhinoMocks assembly is not trusted

I want to write some blogpost about RhinoMocks. I made a TestProject in Visual Studio.Net 2008 to make some examples. The first thing I did was to add a reference to the RhinoMocks assembly. I made a test and it would not excute. This is all I got at first:

I did not understand why. I looked up more information about the testrun. This is what I found: The location of the file or directory ‘c:\users\<<user>>\documents\visual studio 2008\projects\rhinomocksdemos\rhinomocksdemos\bin\debug\Rhino.Mocks.dll’ is not trusted. Not trusted?! Its my computer. I downloaded it. I trust it. Windows is being stubborn (again). How can I solve this? Why does this happen?

As it turns out Windows (XP SP2 and above) is just being carefull. It adds a marker to a file downloaded from internet indicating that it may not be safe to execute it. Normally Windows will show a ‘Are you sure?’ dialog when you try to use the file. In my case it showed nothing obvious and left me in the dark. It would have been nice if Windows showed this error and the solution. It is a missed chance but then again I would not have anything to do if the world was perfect. The solution is simple: go to the properties of the file and click the unblock button on the General tab. Look at the screenshot below. Next click on the Apply button and then on the Ok button. The problem is solved. Testing and mocking can start.

 

 References:

http://social.msdn.microsoft.com/forums/en-US/vststest/thread/0d8d89d1-e373-4a29-9325-febf748a771c/