title: Sharepoint event receiver and linq to sharepoint
body: <p>I have a sandboxed solution and access some lists with Linq-to-Sharepoint. Now I attached an event receiver to the list type <code>101</code> because I have to restrict some files uploaded to picture libraries. This works fine.</p>
  
  <p>But now my Linq-to-Sharepoint throws an error when I try to insert a new item to a list (only with Linq, it works fine if I create new items on that list via the regular user interface).</p>
  
  <p>The error is <code>0x81020089</code> with the message <code>The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request.</code> but the message is just default as the host service is not too busy and 0x81020089 is kind of a problem with an event receiver. </p>
  
  <p>Everything works fine if I dont attach the event receiver but the error occurs when I do so - even if there is no code in the event receiver at all.</p>
  
  <p>Any ideas?</p>
  
  <hr>
  
  <p><strong>Error message</strong></p>
  
  <p>0x81020089 The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request.</p>
  
  <p><strong>Server stack trace</strong></p>
  
  <ul>
  <li>at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)</li>
  <li>at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32&amp; plID, String&amp; pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object&amp; pvarAttachmentNames, Object&amp; pvarAttachmentContents, Object&amp; pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback)</li>
  <li>at Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32&amp; ulID, Object&amp; objAttachmentNames, Object&amp; objAttachmentContents, Boolean suppressAfterEvents, String filename)</li>
  <li>at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String filename)</li>
  <li>at Microsoft.SharePoint.SPListItem.Update()</li>
  <li>at Microsoft.SharePoint.SPListItem_SubsetProxy.Update__Inner()</li>
  <li>at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]&amp; outArgs)</li>
  <li>at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext) </li>
  </ul>