none
Adding ContentType when using language packs RRS feed

  • Question

  • Hi.

     

    I have the following scenario: 

    - create a SPContentType using the constructor (id, collection, name) - id = WorkflowTask id + a guid

    - delete the content type

    - try to re-add it. The following error occurs: the  A duplicate content type "myContentType" was found.

    This happens only if I have a pwa created with a language different than en-US. 

    The scenario with creating, deleting, creating works on a different language pwa if I create the content type using the constructor (parentContentType, collection, name)

     

    Any idea?

    Thanks.

    Monday, July 26, 2010 2:07 PM

Answers

  • Seems like when creating ContentTypes, the thread UICulture must be the same as SPWeb UICulture so adding the code below solved the problem:

     

    System.Threading.Thread.CurrentThread.CurrentUICulture = myWeb.UICulture; 

     

    • Marked as answer by Mealexro Friday, July 30, 2010 9:38 AM
    Friday, July 30, 2010 9:38 AM

All replies

  • Hi Mealexro,

    Can you find the content type 'myContentType' even after deletion?  I am wondering if in the case of having multiple language packs loaded that you are getting multiple content types created and then only 1 is deleted - but just a guess.

    Best regards,

    Brian.


    Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page
    Thursday, July 29, 2010 8:32 PM
    Owner
  • No, after deletion, I searched into sharepoint DB and there was no content type having the ID of my content type. 

     

    It is strange that this happens only if I create ContentTypes using the constructor with ContentyTypeID.

     

     

    Friday, July 30, 2010 8:29 AM
  • Seems like when creating ContentTypes, the thread UICulture must be the same as SPWeb UICulture so adding the code below solved the problem:

     

    System.Threading.Thread.CurrentThread.CurrentUICulture = myWeb.UICulture; 

     

    • Marked as answer by Mealexro Friday, July 30, 2010 9:38 AM
    Friday, July 30, 2010 9:38 AM