Sharepoint COMException 0x81020037

Sometimes I see the ItemAdded or ItemUpdated firing twice for a single operation. You can try to put a breakpoint in the ItemAdded() method to confirm that.

The solution in my case was to single thread the ItemAdded() method:

private static object myLock = new object();
public override void ItemAdded(SPItemEventProperties properties) {
    if (System.Threading.Monitor.TryEnter(myLock, TimeSpan.FromSeconds(30))
    {
        //do your stuff here.
        System.Threading.Monitor.Exit(myLock);
    }
}
原文地址:https://www.cnblogs.com/olay/p/4988996.html