Friday, August 7, 2015

The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread’s user context, which may be the case when the thread is impersonating.

I was recently developing an ASP.NET MVC Web Application and adding Claims support for User Information when I suddenly encountered the following error message:

The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.

Fortunately, a quick search on Google returned the following article: https://mytechlifedays.wordpress.com/2012/02/09/the-data-protection-operation-was-unsuccessful-this-may-have-been-caused-by-not-having-the-user-profile-loaded-for-the-current-threads-user-context-which-may-be-the-case-when-the-thread-is-imperso/

The solution was surprisingly simple and only required that the Application Pool be modified to support Loading the User Profile!!  Once I did that, my ASP.NET Web Application worked correctly!!

1 comment: