Answered Content Type Deployment Error

  • Friday, April 23, 2010 9:53 AM
     
     

    I got this error

    Error occurred in deployment step 'Activate Features': The content type with Id [GUID] defined in feature [GUID] was found in the current site collection or in a subsite.

    Any ideas???

     

Answers

  • Tuesday, April 27, 2010 3:40 PM
     
     Answered

    Finally I tryed this.. seems to work... today.. but tomorrow???

    in vs2010 go in My Project -> Sharepoint -> Edit Configuration Tab and create a new configuration..

    in "Selected Deployment Steps" insert (in order):

    - recycle iis app pool
    - run pre deployment command
    - retract solution
    - add solution
    - run post deployment command
    - recycle app pool
    - activate features

    in Active Deployment Configuration select your new configuration and try!

    Seems work

    jent

     

    • Marked As Answer by jent Tuesday, April 27, 2010 3:40 PM
    •  

All Replies

  • Friday, April 23, 2010 1:25 PM
     
      Has Code

    Hi Jent,

                As per the error discription it seams that the contentype that you are deploying already exits. Please check the id of you content type in available content type. You can check for duplicate contenttype by iterating through as follows :-

                    

    SPContentTypeId myId = new SPContentTypeId("0x01");
    
    SPContentType cont = web.AvailableContentTypes[myId];
    
    Where,
    
    myId = Id of your contentType
    Web = site where you are activating your feature
    However, it would be better to give a new id to the contenttype you intending to deploy.


    Deepak Kejriwal
  • Friday, April 23, 2010 1:45 PM
     
     

    Hy Deep,

    thanks..

    the problem is that i have a solution vs2010 with a content type and when i try to re-deploy it give me that error..

    i can not change the id of the content type any times that i have to deploy...

  • Friday, April 23, 2010 8:31 PM
     
     

    try this : right click the solution in VS2010 and select "Retract"; then deploy it again..

    Let me know if this works..


    MCPD (PRO: Designing and Developing Web-based Applications by Using the Microsoft® .NET Framework 2.0) MCTS (MOSS 2007 - Application Development)
  • Sunday, April 25, 2010 8:01 PM
     
     

    thanks Aanu..I tried but is not working... the error appears in the next deploy

    the solution is retracted, and the content type there isn't... so.. everything is ok (it seems!)...

    BUT (!) when i re-deploy the solution, on feature activating, the error appears.. the feature isn't activated but (sometimes!!!) the content type appears there (sometimes no!!) And when i try to activate the feature... ERROR!

     

     

     

  • Sunday, April 25, 2010 8:49 PM
     
     Proposed Answer

    Try to set Overwrite="TRUE" in your content type definition. It should work.

    Hope that helps

    Michele

    • Proposed As Answer by Tammie_ Friday, April 20, 2012 5:41 AM
    •  
  • Monday, April 26, 2010 7:29 AM
     
     

    Thanks Michele,

    i tryed but i have this error in vs2010: Error occurred in deployment step 'Activate Features':

    .. there is no comment after the ':' ...

    and there is no logs in the event viewer..

    it makes me mad!

     

     

  • Monday, April 26, 2010 8:02 AM
     
     
    Can you post the xml of the content type in question?
  • Monday, April 26, 2010 10:36 AM
     
     Proposed Answer

    Here it is..

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <!-- Parent ContentType: Item (0x01) -->
      <ContentType ID="0x0100350f61ce5b1546848b778172be6d44c8"
                   Name="MyContent"
                   Group="Custom Content Types"
                   Description="My Content Type"
                   Inherits="FALSE"
                   Overwrite="TRUE"
                   Version="0">
        <FieldRefs>
      <FieldRef ID="{5C1BDF8C-A6E5-49c3-BDAC-B4D9413CB5EB}" Name="Title" DisplayName="Title" Required="TRUE" ShowInNewForm="TRUE" ShowInEditForm="TRUE" />
        </FieldRefs>
     <XmlDocuments>
        <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
         <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
          <Edit>MyForm</Edit>
          <New>MyForm</New>
          <Display>MyForm</Display>
         </FormTemplates>
        </XmlDocument>
      </XmlDocuments>
      </ContentType>
    </Elements>

    • Proposed As Answer by Tammie_ Friday, April 20, 2012 5:41 AM
    •  
  • Tuesday, April 27, 2010 3:27 PM
     
     
    I get the same error and I'm very interested to see if there's a workaround.
  • Tuesday, April 27, 2010 3:40 PM
     
     Answered

    Finally I tryed this.. seems to work... today.. but tomorrow???

    in vs2010 go in My Project -> Sharepoint -> Edit Configuration Tab and create a new configuration..

    in "Selected Deployment Steps" insert (in order):

    - recycle iis app pool
    - run pre deployment command
    - retract solution
    - add solution
    - run post deployment command
    - recycle app pool
    - activate features

    in Active Deployment Configuration select your new configuration and try!

    Seems work

    jent

     

    • Marked As Answer by jent Tuesday, April 27, 2010 3:40 PM
    •  
  • Tuesday, April 27, 2010 4:25 PM
     
     Proposed Answer
    Try setting Inherits="TRUE"
    • Proposed As Answer by MSNGN [tim] Wednesday, July 13, 2011 6:56 PM
    •  
  • Tuesday, April 27, 2010 4:49 PM
     
     
    Try setting Inherits="TRUE"


    This will lose the changes to use the custom forms:

    <XmlDocuments>
        <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
         <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
          <Edit>MyForm</Edit>
          <New>MyForm</New>
          <Display>MyForm</Display>
         </FormTemplates>
        </XmlDocument>

    Jent's solution seems to work for me to.

     

  • Thursday, June 03, 2010 10:07 AM
     
     

    Hi,

    These doesn't work for me :

    I have tried to change the guid of the content type but the same error after a while with the new guid.

    I have tried with  Overwrite="TRUE".

    I have got a new error :

    Feature Activation: Threw an exception, attempting to roll back.  Feature 'WorkflowProject2_Feature1' (ID: '3ae1c5fe-c521-4c33-9559-ec1b7e857596').  Exception: Microsoft.SharePoint.SPException ---> System.Runtime.InteropServices.COMException (0x80070055): <nativehr>0x80070055</nativehr><nativestack></nativestack>   
     at Microsoft.SharePoint.Library.SPRequestInternalClass.ThrowError(Int32 dwErr)   
     at Microsoft.SharePoint.Library.SPRequest.ThrowError(Int32 dwErr)     -
     -- End of inner exception stack trace ---   
     at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionFieldsAndContentTypes(SPFeaturePropertyCollection props, SPSite site, SPWeb web, Boolean fForce)   
     at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, Boolean fForce)   
     at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, Boolean fForce)

    I have also a lot  of errors while the deployment :

    Unable to locate the xml-definition for CType with SPContentTypeId '0x01080100CAC763E335B64471A8E361345920E1EE', exception: Microsoft.SharePoint.SPException ---> System.Runtime.InteropServices.COMException (0x8000FFFF): <nativehr>0x8000ffff</nativehr><nativestack></nativestack>   
     at Microsoft.SharePoint.Library.SPRequestInternalClass.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)   
     at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)     -
     -- End of inner exception stack trace ---   
     at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)   
     at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)   
     at Microsoft.SharePoint.SPContentTypeCollection.FillCollection(SPRequest req, SqlDataReader rdr, Boolean openWeb)

    Any way to clean the sharepoint referentiel database by stsadm.exe ?

     

     

     

     

     

  • Monday, September 20, 2010 6:28 PM
     
     

    I have the same issue. I also have site columns. It seems to me that VS 2010 complains about either the contenttype id or the site column id.

    I put Jent's suggetion in, it did not work.

    I also has Overwrite="TRUE" and it did not work.

    Then I went to web UI and I was able to activate the feature from the web UI.

    Very strange problem.


    Blog: http://convergingpoint.blogspot.com/
  • Thursday, January 13, 2011 6:23 AM
     
     

    Dave, this did the trick for me, thanks!


    MSNGN: Smart Simple Solutions http://www.msngn.com
  • Wednesday, July 13, 2011 7:27 AM
     
     
    this didnt work for me.. i have the same set of problem. can you tell me that do you finally find a solution of it ?
  • Wednesday, July 20, 2011 11:46 AM
     
     

    stop-process -processname vssphost4 -force

    http://tchmiel.wordpress.com/2010/08/09/activate-feature-error-custom-content-types-when-debugging-from-visual-studio-2010/

    Thanks Tom

    The only solution worked for me.

    Kirill

  • Thursday, September 01, 2011 6:43 PM
     
     
    None of these solutions worked for me.  I spent about 2 hours trying to figure this issue out.  Finally, I just deleted the Site Collection that the custom content type lived on.  After the site was deleted, I was able to build/deploy my solution!