Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have defined in a VS project a custom content type "Parent". I want to let the user create (from the ui) child content type of this content type, while benefiting some shared behavior (auto filling some fields, like the email).

In this content type, I've set up an event receiver (Farm solution) :

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ContentType ID="0x0100C74070DC6A24431BAFDA7E34EB40AB71"
               Name="Parent"            
               Description="Parent"
               Inherits="FALSE"
               Version="0">
    <FieldRefs>

      <FieldRef ID="{82642ec8-ef9b-478f-acf9-31f7d45fbc31}"
                Name="LinkTitle"
                DisplayName="$Resources:core,Last_Name;"
                Sealed="TRUE" ShowInEditForm="FALSE" ShowInNewForm="FALSE"/>
      <FieldRef ID="{bc91a437-52e7-49e1-8c4e-4698904b2b6d}"
                Name="LinkTitleNoMenu"
                DisplayName="$Resources:core,Last_Name;"
                Sealed="TRUE" ShowInEditForm="FALSE" ShowInNewForm="FALSE"/>
      <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}"
                Name="Title"
                Required="false"
                DisplayName="$Resources:core,Last_Name;"
                Sealed="TRUE" ShowInEditForm="FALSE" ShowInNewForm="FALSE"/>
      <FieldRef ID="{fce16b4c-fe53-4793-aaab-b4892e736d15}"
                Name="EMail"
                ShowInEditForm="FALSE"
                ShowInNewForm="FALSE" />         
    </FieldRefs>
    <XmlDocuments>
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
        <Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
          <Receiver>
            <Name>GenericFormItemEventReceiverItemAdded</Name>
            <Type>ItemAdded</Type>
            <SequenceNumber>10000</SequenceNumber>
            <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
            <Class>$SharePoint.Type.2809b400-3edc-4dd0-a06a-64bc98c82f70.FullName$</Class>
            <SolutionId>$SharePoint.Package.Id$</SolutionId>
            <Data></Data>
            <Filter></Filter>
            <Synchronization>Synchronous</Synchronization>
          </Receiver>
        </Receivers>
      </XmlDocument>
    </XmlDocuments>
  </ContentType>
</Elements>

I also created a custom list schema, that include this content type. When instantiated as is, the event receiver is working as expected.

Now I'm creating from the UI a child content type, that inherits Parent.

However, if I create a list with child as the only content type, the event receiver is not fired, and an exception occurs :

No available sandboxed code execution server could be found

Quite strange as my whole solution is a farm solution.

Just in case, I activate the user code host on my box. The error is now :

Error loading and running event receiver MyProject.MyReceiver in MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=dcb1ce1bdfc30252. Additional information is below. The request could not be completed because the specified solution was not found.

What is the proper way to handle my scenario?

FYI, I've checked using SharePoint Manager 2010 the schema of the content types on the associated lists.

Both schema are strictly identical. Both contains the XmlDocument node with the receiver registration (same as the snippet above).

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.