This error can be caused by a variety of reasons. In my case I got it when I published my ASP.NET MVC 2 application to my local IIs instance in IIS 7.5 / Windows 7.
As it turns out, I needed to set the application pool account property “Load User profile” to true:
That did the trick.