title: Problems with SharePoint EventReceiver ItemUpdating on Custom List Definition
body: <p>I have a problem with my CustomListDefinition and a CustomEventReceiver.</p>
  
  <p>The ListDefinition works fine. I can create Lists out of it and everything looks as it should. My EventReceiver acts on the following four events: ItemAdding, ItemAdded, ItemUpdating and ItemUpdated.</p>
  
  <p>While adding/updating ListItems via WebInterface, everythings works without any errors. When I try to create or edit a ListItem via C# (or PowerShell), I get the following error: </p>
  
  <blockquote>
    <p>"Unknown Status Module: 33 Message: 134"</p>
  </blockquote>
  
  <p>even when the code is doing really <strong>nothing</strong>! I reproduced the problem with a new and empty EventReceiver, that is attached to the ItemUpdating event of my custom ListDefinition.</p>
  
  <p>This problem occurs only on the <strong>ItemUpdating</strong> event. When I deploy my solution without this event, everything is going on well. Deploying an EventReceiver to standard list (e.g. Task ListDefinition) there is no problem like above, too. </p>
  
  <p>So my conclusion is, there must be an error in my ListDefinition.</p>
  
  <p>Can someone help me finding the error?</p>
  
  <p><strong>My Elements.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
      &lt;!-- Do not change the value of the Name attribute below. If it does not match the folder name of the List Definition project item, an error will occur when the project is run. --&gt;
      &lt;ListTemplate
          Name="MyProject.ListDefinition.Booking"
          Type="10001"
          BaseType="0"
          OnQuickLaunch="TRUE"
          SecurityBits="11"
          AllowDeletion="TRUE"
          DisallowContentTypes="FALSE"
          Sequence="410"
          DisplayName="Anmeldung"
          Description="Anmeldeliste für ein Fest"
          Image="/_layouts/images/itgen.png"/&gt;
  &lt;/Elements&gt;
  </code></pre>
  
  <p><strong>My Schema.xml (ContentType and Field Definitions defined as in the code below)</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;List xmlns:ows="Microsoft SharePoint" Title="Fest Anmeldung" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/Fest-MyProject.ListDefinition.Booking" BaseType="0" EnableContentTypes="TRUE" DisableAttachments="TRUE" EnableMinorVersions="FALSE" ModeratedList="FALSE" PrivateList="FALSE" VersioningEnabled="FALSE" xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
    &lt;MetaData&gt;
      &lt;ContentTypes&gt;
        &lt;ContentType ID="0x0100d05f16219b3543eb81f2b7707d50a4d3" Name="externer Teilnehmer" Group="MyProject.Fest" Description="externer Teilnehmer am Fest" Inherits="TRUE" Version="0"&gt;
          &lt;FieldRefs&gt;
            &lt;FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" DisplayName="Titel" Required="FALSE" /&gt;
            &lt;FieldRef ID="{F168D67A-8BE4-42ED-B3D6-D04C3CE487F9}" Name="MyProjectFestFirstName" /&gt;
            &lt;FieldRef ID="{EA8D4CAA-A219-43ED-8796-345E387BD4C6}" Name="MyProjectFestLastName" /&gt;
            &lt;FieldRef ID="{A29AE60F-BCCA-47B5-A498-17B4E7FD4297}" Name="MyProjectFestParticipates" /&gt;
            &lt;FieldRef ID="{08885975-334B-4BB6-B7A7-052610C2F885}" Name="MyProjectFestPartner" /&gt;
            &lt;FieldRef ID="{5E480332-98F6-4328-955E-037F6F1C66DE}" Name="MyProjectFestChildrenCount0To3" /&gt;
            &lt;FieldRef ID="{0BD4A5E1-171F-41AA-9628-979694549807}" Name="MyProjectFestChildrenCount4To8" /&gt;
            &lt;FieldRef ID="{90F8CEE7-289B-499B-AA6E-3BE92568948D}" Name="MyProjectFestChildrenCount9To15" /&gt;
            &lt;FieldRef ID="{9EB35619-530A-4149-9889-1CEDB7CF3C9F}" Name="MyProjectFestChildrenCount16" /&gt;
            &lt;FieldRef ID="{6B63D7A4-4FCC-4C16-979A-BB640FAADA61}" Name="MyProjectFestArrivalDate" /&gt;
            &lt;FieldRef ID="{B390E3B7-76C8-4E03-A54E-FD3106689FFE}" Name="MyProjectFestAccommodations" /&gt;
            &lt;FieldRef ID="{DEE42C9A-238E-4E93-971B-6BFE3BE5B53B}" Name="MyProjectFestFood" /&gt;
            &lt;FieldRef ID="{A6056EA2-E4B8-4555-B5FF-0CDD8FD415FC}" Name="MyProjectFestParticipantCount" /&gt;
            &lt;FieldRef ID="{C204C403-CDD5-4A09-AF58-A21D7AEBF985}" Name="MyProjectFestBranch" /&gt;
            &lt;FieldRef ID="{EF54ACED-E2BE-4EB7-BF39-1D2A46202DFC}" Name="MyProjectFestDescription" /&gt;
          &lt;/FieldRefs&gt;
        &lt;/ContentType&gt;
        &lt;ContentType ID="0x0100e498ffd129d6485fbe5174d501bbf362" Name="interner Teilnehmer" Group="MyProject.Fest" Description="interner Teilnehmer am Fest" Inherits="TRUE" Version="0"&gt;
          &lt;FieldRefs&gt;
            &lt;FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" DisplayName="Titel" Required="FALSE" /&gt;
            &lt;FieldRef ID="{F168D67A-8BE4-42ED-B3D6-D04C3CE487F9}" Name="MyProjectFestFirstName" /&gt;
            &lt;FieldRef ID="{EA8D4CAA-A219-43ED-8796-345E387BD4C6}" Name="MyProjectFestLastName" /&gt;
            &lt;FieldRef ID="{A29AE60F-BCCA-47B5-A498-17B4E7FD4297}" Name="MyProjectFestParticipates" /&gt;
            &lt;FieldRef ID="{08885975-334B-4BB6-B7A7-052610C2F885}" Name="MyProjectFestPartner" /&gt;
            &lt;FieldRef ID="{5E480332-98F6-4328-955E-037F6F1C66DE}" Name="MyProjectFestChildrenCount0To3" /&gt;
            &lt;FieldRef ID="{0BD4A5E1-171F-41AA-9628-979694549807}" Name="MyProjectFestChildrenCount4To8" /&gt;
            &lt;FieldRef ID="{90F8CEE7-289B-499B-AA6E-3BE92568948D}" Name="MyProjectFestChildrenCount9To15" /&gt;
            &lt;FieldRef ID="{9EB35619-530A-4149-9889-1CEDB7CF3C9F}" Name="MyProjectFestChildrenCount16" /&gt;
            &lt;FieldRef ID="{6B63D7A4-4FCC-4C16-979A-BB640FAADA61}" Name="MyProjectFestArrivalDate" /&gt;
            &lt;FieldRef ID="{B390E3B7-76C8-4E03-A54E-FD3106689FFE}" Name="MyProjectFestAccommodations" /&gt;
            &lt;FieldRef ID="{DEE42C9A-238E-4E93-971B-6BFE3BE5B53B}" Name="MyProjectFestFood" /&gt;
            &lt;FieldRef ID="{A6056EA2-E4B8-4555-B5FF-0CDD8FD415FC}" Name="MyProjectFestParticipantCount" /&gt;
            &lt;FieldRef ID="{C204C403-CDD5-4A09-AF58-A21D7AEBF985}" Name="MyProjectFestBranch" ShowInDisplayForm="TRUE" ShowInEditForm="FALSE" /&gt;
            &lt;FieldRef ID="{3BAC8D07-9B0D-4D8A-8899-8A398E94A5DC}" Name="MyProjectFestSystemMitaId" ShowInDisplayForm="TRUE" ShowInEditForm="FALSE"  /&gt;
            &lt;FieldRef ID="{026BDDB3-C776-4873-A82D-1A87BA4FE4B8}" Name="MyProjectFestSystemAccount" ShowInDisplayForm="TRUE" ShowInEditForm="FALSE"  /&gt;
            &lt;FieldRef ID="{99EB27C2-156A-42AD-AC42-8BE91AE1CEC7}" Name="MyProjectFestActivityStatus" ShowInDisplayForm="TRUE" ShowInEditForm="FALSE"  /&gt;
          &lt;/FieldRefs&gt;
        &lt;/ContentType&gt;
      &lt;/ContentTypes&gt;
      &lt;Fields&gt;
        &lt;Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" Type="Text" DisplayName="Titel" Required="FALSE" /&gt;
  
        &lt;Field
     ID="{F168D67A-8BE4-42ED-B3D6-D04C3CE487F9}"
     Name="MyProjectFestFirstName"
     DisplayName="Vorname"
     Type="Text"
     Required="TRUE"
     Sealed="TRUE"
     AllowDeletion="FALSE"
     Group="MyProjectFest"
     Filterable="TRUE"
     Sortable="TRUE" /&gt;
  
        &lt;Field
          ID="{EA8D4CAA-A219-43ED-8796-345E387BD4C6}"
          Name="MyProjectFestLastName"
          DisplayName="Nachname"
          Type="Text"
          Required="TRUE"
          Sealed="TRUE"
          AllowDeletion="FALSE"
          Group="MyProjectFest"
          Filterable="TRUE"
          Sortable="TRUE" /&gt;
  
        &lt;Field
          ID="{A29AE60F-BCCA-47B5-A498-17B4E7FD4297}"
          Name="MyProjectFestParticipates"
          DisplayName="Teilnahme am Fest"
          Type="Boolean"
          Required="FALSE"
          Sealed="TRUE"
          AllowDeletion="FALSE"
          Description="Falls nein, müssen die weiteren Felder nicht ausgefüllt werden!"
          Group="MyProjectFest"
          Filterable="TRUE"
          Sortable="TRUE"  /&gt;
  
        &lt;Field
          ID="{08885975-334B-4BB6-B7A7-052610C2F885}"
          Name="MyProjectFestPartner"
          DisplayName="Teilnahme Partner"
          Type="Boolean"
          Required="FALSE"
          Sealed="TRUE"
          AllowDeletion="FALSE"
          Group="MyProjectFest"
          Filterable="TRUE"
          Sortable="TRUE"  /&gt;
  
        &lt;Field
          ID="{5E480332-98F6-4328-955E-037F6F1C66DE}"
          Name="MyProjectFestChildrenCount0To3"
          DisplayName="Anzahl Kinder (0-3)"
          Type="Number"
          Decimals="0"
          Min="0"
          Max="10"
          Required="FALSE"
          Sealed="TRUE"
          AllowDeletion="FALSE"
          Group="MyProjectFest"
          Filterable="TRUE"
          Sortable="TRUE"  /&gt;
  
        &lt;Field
          ID="{0BD4A5E1-171F-41AA-9628-979694549807}"
          Name="MyProjectFestChildrenCount4To8"
          DisplayName="Anzahl Kinder (4-8)"
          Type="Number"
          Decimals="0"
          Min="0"
          Max="10"
          Required="FALSE"
          Sealed="TRUE"
          AllowDeletion="FALSE"
          Group="MyProjectFest"
          Filterable="TRUE"
          Sortable="TRUE"  /&gt;
  
        &lt;Field
          ID="{90F8CEE7-289B-499B-AA6E-3BE92568948D}"
          Name="MyProjectFestChildrenCount9To15"
          DisplayName="Anzahl Kinder (9-15)"
          Type="Number"
          Decimals="0"
          Min="0"
          Max="10"
          Required="FALSE"
          Sealed="TRUE"
          AllowDeletion="FALSE"
          Group="MyProjectFest"
          Filterable="TRUE"
          Sortable="TRUE"  /&gt;
  
        &lt;Field
          ID="{9EB35619-530A-4149-9889-1CEDB7CF3C9F}"
          Name="MyProjectFestChildrenCount16"
          DisplayName="Anzahl Kinder (16+)"
          Type="Number"
          Decimals="0"
          Min="0"
          Max="10"
          Required="FALSE"
          Sealed="TRUE"
          AllowDeletion="FALSE"
          Group="MyProjectFest"
          Filterable="TRUE"
          Sortable="TRUE"  /&gt;
  
        &lt;Field
          ID="{6B63D7A4-4FCC-4C16-979A-BB640FAADA61}"
          Name="MyProjectFestArrivalDate"
          DisplayName="Anreise-Datum"
          Type="DateTime"
          Format="DateOnly"
          Required="FALSE"
          Sealed="TRUE"
          AllowDeletion="FALSE"
          Group="MyProjectFest"
          Filterable="TRUE"
          Sortable="TRUE"  /&gt;
  
        &lt;Field
          ID="{B390E3B7-76C8-4E03-A54E-FD3106689FFE}"
          Name="MyProjectFestAccommodations"
          DisplayName="Anzahl Übernachtungen"
          Type="Number"
          Decimals="0"
          Min="0"
          Max="10"
          Required="FALSE"
          Sealed="TRUE"
          AllowDeletion="FALSE"
          Group="MyProjectFest"
          Filterable="TRUE"
          Sortable="TRUE"  /&gt;
  
        &lt;Field
          ID="{DEE42C9A-238E-4E93-971B-6BFE3BE5B53B}"
          Name="MyProjectFestFood"
          DisplayName="mitgebrachte Speise"
          Type="Text"
          Required="FALSE"
          Sealed="TRUE"
          AllowDeletion="FALSE"
          Group="MyProjectFest"
          Filterable="TRUE"
          Sortable="TRUE"  /&gt;
  
        &lt;Field ID="{3bac8d07-9b0d-4d8a-8899-8a398e94a5dc}" Name="MyProjectFestSystemMitaId" DisplayName="SYSTEM_MITA_ID" Type="Number" Decimals="0" Required="FALSE" Sealed="TRUE" AllowDeletion="FALSE" Group="MyProjectFest" /&gt;
        &lt;Field ID="{026bddb3-c776-4873-a82d-1a87ba4fe4b8}" Name="MyProjectFestSystemAccount" DisplayName="Account-Name" Type="Text" MaxLength="5" Required="FALSE" Sealed="TRUE" AllowDeletion="FALSE" Group="MyProjectFest" /&gt;
        &lt;Field ID="{99eb27c2-156a-42ad-ac42-8be91ae1cec7}" Name="MyProjectFestActivityStatus" DisplayName="Status" Type="Text" MaxLength="10" Required="FALSE" Sealed="TRUE" AllowDeletion="FALSE" Group="MyProjectFest" /&gt;
  
        &lt;Field ID="{ef54aced-e2be-4eb7-bf39-1d2a46202dfc}" Name="MyProjectFestDescription" DisplayName="Beschreibung" Type="Note" NumLines="3" Required="FALSE" Sealed="TRUE" AllowDeletion="FALSE" Group="MyProjectFest" Filterable="TRUE" Sortable="TRUE" /&gt;
        &lt;Field ID="{c204c403-cdd5-4a09-af58-a21d7aebf985}" Name="MyProjectFestBranch" DisplayName="Niederlassung" Type="Choice" Format="Dropdown" BaseType="Text" Required="FALSE" Sealed="FALSE" AllowDeletion="FALSE" Group="MyProjectFest" Filterable="TRUE" Sortable="TRUE"&gt;
          &lt;CHOICES&gt;
            &lt;CHOICE&gt;B&lt;/CHOICE&gt;
            &lt;CHOICE&gt;E&lt;/CHOICE&gt;
            &lt;CHOICE&gt;HH&lt;/CHOICE&gt;
            &lt;CHOICE&gt;K&lt;/CHOICE&gt;
            &lt;CHOICE&gt;M&lt;/CHOICE&gt;
          &lt;/CHOICES&gt;
          &lt;Default&gt;K&lt;/Default&gt;
        &lt;/Field&gt;
  
        &lt;Field
          ID="{A6056EA2-E4B8-4555-B5FF-0CDD8FD415FC}"
          Name="MyProjectFestParticipantCount"
          DisplayName="Teilnehmeranzahl"
          Type="Calculated"
          ResultType="Number"
          ReadOnly="FALSE"
          Hidden="FALSE"
          Decimals="0"
          Group="MyProjectFest"&gt;
          &lt;Formula&gt;=IF([MyProjectFestParticipates]=TRUE,1+IF([MyProjectFestPartner]=TRUE,1,0)+[MyProjectFestChildrenCount0To3]+[MyProjectFestChildrenCount4To8]+[MyProjectFestChildrenCount9To15]+[MyProjectFestChildrenCount16],0)&lt;/Formula&gt;
          &lt;FieldRefs&gt;
            &lt;FieldRef Name="MyProjectFestParticipates" /&gt;
            &lt;FieldRef Name="MyProjectFestPartner" /&gt;
            &lt;FieldRef Name="MyProjectFestChildrenCount0To3" /&gt;
            &lt;FieldRef Name="MyProjectFestChildrenCount4To8" /&gt;
            &lt;FieldRef Name="MyProjectFestChildrenCount9To15" /&gt;
            &lt;FieldRef Name="MyProjectFestChildrenCount16" /&gt;
          &lt;/FieldRefs&gt;
        &lt;/Field&gt;
      &lt;/Fields&gt;
      &lt;Views&gt;
        &lt;View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE"&gt;
          &lt;Toolbar Type="Standard" /&gt;
          &lt;XslLink Default="TRUE"&gt;main.xsl&lt;/XslLink&gt;
          &lt;RowLimit Paged="TRUE"&gt;30&lt;/RowLimit&gt;
          &lt;ViewFields&gt;
            &lt;FieldRef Name="LinkTitleNoMenu"&gt;
            &lt;/FieldRef&gt;
            &lt;FieldRef Name="MyProjectFestFirstName" /&gt;
            &lt;FieldRef Name="MyProjectFestLastName" /&gt;
            &lt;FieldRef Name="MyProjectFestParticipates" /&gt;
            &lt;FieldRef Name="MyProjectFestParticipantCount" /&gt;
          &lt;/ViewFields&gt;
          &lt;Query&gt;
            &lt;OrderBy&gt;
              &lt;FieldRef Name="Modified" Ascending="FALSE"&gt;
              &lt;/FieldRef&gt;
            &lt;/OrderBy&gt;
          &lt;/Query&gt;
          &lt;ParameterBindings&gt;
            &lt;ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" /&gt;
            &lt;ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" /&gt;
            &lt;ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" /&gt;
          &lt;/ParameterBindings&gt;
        &lt;/View&gt;
        &lt;View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx"&gt;
          &lt;Toolbar Type="Standard" /&gt;
          &lt;XslLink Default="TRUE"&gt;main.xsl&lt;/XslLink&gt;
          &lt;RowLimit Paged="TRUE"&gt;30&lt;/RowLimit&gt;
          &lt;ViewFields&gt;
            &lt;FieldRef Name="Attachments"&gt;
            &lt;/FieldRef&gt;
            &lt;FieldRef Name="LinkTitle"&gt;
            &lt;/FieldRef&gt;
            &lt;FieldRef Name="MyProjectFestFirstName" /&gt;
            &lt;FieldRef Name="MyProjectFestLastName" /&gt;
            &lt;FieldRef Name="MyProjectFestParticipates" /&gt;
            &lt;FieldRef Name="MyProjectFestParticipantCount" /&gt;
          &lt;/ViewFields&gt;
          &lt;Query&gt;
            &lt;OrderBy&gt;
              &lt;FieldRef Name="ID"&gt;
              &lt;/FieldRef&gt;
            &lt;/OrderBy&gt;
          &lt;/Query&gt;
          &lt;ParameterBindings&gt;
            &lt;ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" /&gt;
            &lt;ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" /&gt;
          &lt;/ParameterBindings&gt;
        &lt;/View&gt;
      &lt;/Views&gt;
      &lt;Forms&gt;
        &lt;Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" /&gt;
        &lt;Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" /&gt;
        &lt;Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" /&gt;
      &lt;/Forms&gt;
    &lt;/MetaData&gt;
  &lt;/List&gt;
  </code></pre>
  
  <p>The code is a little bit anonymized and could contain some typing errors because of that. ;)</p>
  
  <p>Hope you can help me find my problem.</p>
  
  <p>Edit:
  I found out, that this error is occurring in the event log:</p>
  
  <blockquote>
    <p>Error loading and running event receiver
    MyProject.BookingItemEventReceiver in OC.Sommerfest, Version=1.0.0.0,
    Culture=neutral, PublicKeyToken=asdasdasd. Additional information is
    below.</p>
  </blockquote>
  
  <p>The Event ID is 6875.</p>