.Net does not trust your code. hmm ...
My Colleague and myself were trying to see how to use Rhino Mock in our application. We downloaded the Rhino Mock dll, fired up VS ide, addded some unit test methods, created some mock tests and ran the tests and they failed !!! The error was
Microsoft.VisualStudio.TestTools.TestManagement.ExecutionException: Test Run deployment issue: The location of the file or directory 'c:\testsaddin\bin\debug\Rhino.Mocks.dll' is not trusted.
Hmm that was wierd..so we tried putting the assebly in the GAC (to make it more trustworthy). We were able to add the assembly to the GAC, but it dint show up(in the GAc tab) when we tried to add a reference to it through VS.
after some googling we found out that it was a simple matter of changing a file attribute in the dll. so here is the deal..
If you have downloaded a dll from the internet(through a zip file), windows automatically creates some sort of block attribute on the file. To unblock it you have to "unblock" the file. This property (command Button with caption "unblock") can be found on the "General" tab in file properties. I assume that you would know how to get to the file properties!
And remember, you have to change the attribute on the file used by VS (usually found in the bin/debug folder).
Hope this helps someone!
Microsoft.VisualStudio.TestTools.TestManagement.ExecutionException: Test Run deployment issue: The location of the file or directory 'c:\testsaddin\bin\debug\Rhino.Mocks.dll' is not trusted.
Hmm that was wierd..so we tried putting the assebly in the GAC (to make it more trustworthy). We were able to add the assembly to the GAC, but it dint show up(in the GAc tab) when we tried to add a reference to it through VS.
after some googling we found out that it was a simple matter of changing a file attribute in the dll. so here is the deal..
If you have downloaded a dll from the internet(through a zip file), windows automatically creates some sort of block attribute on the file. To unblock it you have to "unblock" the file. This property (command Button with caption "unblock") can be found on the "General" tab in file properties. I assume that you would know how to get to the file properties!
And remember, you have to change the attribute on the file used by VS (usually found in the bin/debug folder).
Hope this helps someone!


Comments