While using Moq to test an MVC app, and Scott Hanselman’s NerdDinner app, I kept getting these strange errors.
Problem was permissions on:
C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys
In Windows XP Pro, you need to disable simple file sharing.. from http://www.windowsbbs.com/windows-xp/52502-cannot-change-permissions-folder.html
Then I set perms to be full control to everyone:
More granular perms are in here: http://groups.google.co.uk/group/RhinoMocks/browse_thread/thread/26df68ff01567509/5ddebf407228edc4
Now this code works:
On Win7: C:\Users\All Users\Microsoft\Crypto\RSA\MachineKeys
Takes some messing around with granting ownership of the directory, then setting full control to everyone.