SharePoint and the fantastic System.InvalidOperationException

143 Views Asked by At

This is not a question! We have found the solution (I post it later as answer). I hope this can be helpful to someone. Our custom wcf service (deployed in SharePoint 2013) threw a InvalidOperationException inside a SPSecurity.RunWithElevatedPrivileges block. We found many articles on the net with strange and unexplained solutions... So, what happened?

1

There are 1 best solutions below

0
On

Someone has changed the App Pool Account for SharePoint-80 ... but not in the right way: not using the SharePoint Central administration. At this link is explained the right way. After follow this simple example all works fine. I don't know why only the code with RunWithElevatedPrivileges blocks didn't work...