title: Item does not exist. It may have been deleted by another user
body: <p>I keep getting this error:</p>
  
  <pre><code>Item does not exist. It may have been deleted by another user.
  </code></pre>
  
  <p>I dont know if theres something wrong with my assembly, but its breaking here:</p>
  
  <pre><code>Line 227:
  Line 228:
  Line 229:                    SPListItem item = list.GetItemById(Int32.Parse(projectApprovalId));
  Line 230:                    SPFolder itemFolder = item.Folder;
  Line 231:                   
  </code></pre>
  
  <p>I think its something to do with my assembly, like it may not be importing sharepoint correctly.</p>
  
  <p>I am using a .ashx file in my layouts folder, it is an ihttphandler.  Here is what my file looks like:</p>
  
  <pre><code>   &lt;%@ Assembly Name="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&gt;
      &lt;%@ WebHandler Language="C#" Class="jQueryUploadTest.Upload" %&gt;
  
      using System;
      using System.Collections.Generic;
      using System.IO;
      using System.Security.AccessControl;
      using System.Web;
      using System.Web.Script.Serialization;
      using System.Web.UI;
      using System.Web.UI.WebControls;
      using System.Web.UI.WebControls.WebParts;
      using Microsoft.SharePoint;
      //using Microsoft.Office.DocumentManagement.DocumentSets;
  
      namespace jQueryUploadTest {
  
  
  
  public class Upload : IHttpHandler {
          public class FilesStatus
          {/*
              public string thumbnail_url { get; set; }
              public string name { get; set; }
              public string url { get; set; }
              public int size { get; set; }
              public string type { get; set; }
              public string delete_url { get; set; }
              public string delete_type { get; set; }
              public string error { get; set; }
              public string progress { get; set; }
             */
  
              private string m_thumbnail_url;
              private string m_name;
              private string m_url;
              private int m_size;
              private string m_type;
              private string m_delete_url;
      .........
  </code></pre>
  
  <p>Here is the stack trace:</p>
  
  <pre><code>[ArgumentException: Item does not exist. It may have been deleted by another user.]
     Microsoft.SharePoint.SPList.GetItemById(String strId, Int32 id, String strRootFolder, Boolean cacheRowsetAndId, String strViewFields, Boolean bDatesInUtc) +26965608
     Microsoft.SharePoint.SPList.GetItemById(Int32 id) +116
     jQueryUploadTest.Upload.ListCurrentFiles(HttpContext context) in c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\IrvineCompany.SharePoint.CLM\aspx\Upload.ashx:229
     jQueryUploadTest.Upload.ServeFile(HttpContext context) in c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\IrvineCompany.SharePoint.CLM\aspx\Upload.ashx:200
     jQueryUploadTest.Upload.HandleMethod(HttpContext context) in c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\IrvineCompany.SharePoint.CLM\aspx\Upload.ashx:70
     jQueryUploadTest.Upload.ProcessRequest(HttpContext context) in c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\IrvineCompany.SharePoint.CLM\aspx\Upload.ashx:63
     System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599
     System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +171
  </code></pre>
  
  <p>Code where its breaking:</p>
  
  <pre><code>private void ListCurrentFiles (HttpContext context) {
              List&lt;FilesStatus&gt; files = new List&lt;FilesStatus&gt;();
              SPFileCollection fileCollection;
              //using(SPSite siteCollection = new SPSite()){
              using (SPWeb site = SPContext.Current.Web)
                  {
                      string projectApprovalId = string.Empty;
                      if (System.Web.HttpContext.Current.Request.QueryString["ProjectApprovalId"] != null)
                      {
                          projectApprovalId = System.Web.HttpContext.Current.Request.QueryString["ProjectApprovalId"].ToString();
                      }
                      SPList list = site.Lists.TryGetList(GetResourcePropertyValue("KEY_CLM_DocumentLibrary_Name"));
  
  
                      SPListItem item = list.GetItemById(Int32.Parse(projectApprovalId));
                      SPFolder itemFolder = item.Folder;
  
  
                      fileCollection = itemFolder.Files;
  </code></pre>