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 the XML schema information (SPContentType.SchemaXml) of a content type. I am looking for a method that takes this information to recreate the content type at a different location?

Thank you.

PS: The closest that I came to finding this solution is described here (http://www.sharepoint4developers.net/en-nz/post/creating-content-types-programmatically.aspx), but when I tried to use this solution, certain attributes were missing in the resulting SPContentType (e.g. Description).

share|improve this question
    
Please don't crosspost questions between sites. All this really achieves is duplicate information. Can you choose one site to ask this question on? If you don't receive the information you need, you can delete the question and then re-ask it on the other site. –  Kit Menke Aug 2 '11 at 21:31
    
Kit, I did not know about this site when I posted on stackoverflow. And when I did find out about this site, I promptly copied over my question here. I have deleted the old post from stackoverflow. It was not in my intention to crosspost. You, on the other hand, are doing a good job; keep it up. And while you are at it, see if you can answer my question :) Thank you again. –  Tom Aug 3 '11 at 4:36
    
Great! Thanks for following up and welcome to the site. :) –  Kit Menke Aug 3 '11 at 13:52

1 Answer 1

up vote 1 down vote accepted

From your queston or tags i cannot determine if you are using SharePoint 2010 or 2007.

The approach specified with reflection in the link you provide is only relevant in SP2007. In SP2010 content types can be created programmatically from scratch, since we have a constructor. Another approach is to use your manifest xml to create your CT declaratively.

For more info see this MSDN article.

EDIT: corrected link

share|improve this answer
    
Anders, Thank you for your reply. I believe the msdn article url is different from what you intended to post. Could you please check. Thank you again! –  Tom Aug 9 '11 at 19:21
    
Sorry fixed now! (damn iPad!;) –  Anders Rask Aug 9 '11 at 19:48

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.