Tuesday, November 23, 2010

NUnit-console-runner, FileLoadException, access is denied

I was using NUnit, and careless stuffed it into svn from my Linux box.
When I checked it out from svn onto my Windows environment I got this error when trying to run: ./nunit-console.exe:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'nunit-console-runner, Version=, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. Access is denied.
File name: 'nunit-console-runner, Version=, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' ---> System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at NUnit.ConsoleRunner.Class1.Main(String[] args)

I had created a problem for myself because various dll's didn't have 'execute' flag enabled.

To fix this in a brutal way, from the cmd.com, I used:

cacls nunit.core.dll /p /e Everyone:F

No comments: