title: SharePoint 2010 Item Updating Event
body: <p>I'm trying to get create an ItemUpdating event that checks for some potentials issues in a couple of lists. However the item event does not seem to be triggering at all, even debugging the call to ItemUpdating( .. ) does not work, it is as if the method is never called.</p>
  
  <p>Event code:</p>
  
  <pre><code>namespace MyEvent.EventReceiver1
  {
      public class EventReceiver1 : SPItemEventReceiver
      {
         public override void ItemUpdating(SPItemEventProperties properties)
         {
  
             base.ItemUpdating(properties);
  
             // ... my code testing column BeforeProperties vs AfterProperties
             if (properties.ListTitle == "My List")
             {
  
                 if (properties.BeforeProperties["some field"] != properties.AfterProperties["some field"])
                 {
                     properties.Cancel = true;
                     properties.ErrorMessage = "Please do not alter some field in my list";
                 }
             }
         }
      }
  }
  </code></pre>
  
  <p>If I debug "public override void ItemUpdating()" it never fires when updating a list- rather it is "My List" or not. So my check is never run even if "My List" updates an item.</p>
  
  <p>My elements.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
    &lt;Receivers ListTemplateId="100"&gt;
        &lt;Receiver&gt;
          &lt;Name&gt;EventReceiver1ItemUpdating&lt;/Name&gt;
          &lt;Type&gt;ItemUpdating&lt;/Type&gt;
          &lt;Assembly&gt;$SharePoint.Project.AssemblyFullName$&lt;/Assembly&gt;
          &lt;Class&gt;MyEvent.EventReceiver1.EventReceiver1&lt;/Class&gt;
          &lt;SequenceNumber&gt;10000&lt;/SequenceNumber&gt;
        &lt;/Receiver&gt;
    &lt;/Receivers&gt;
  &lt;/Elements&gt;
  </code></pre>
  
  <p>Note that this event receiver is quite a bit more complex in reality.. it fires on several different events with some fairly in-depth functionality. Everything else in the feature works fine except the above ItemUpdating and ItemDeleting methods.</p>