To bracket or not to bracket GUIDs in SharePoint CAML files - a general rule to live by

Friday, October 26, 2007 8:06 AM
Microsoft MVP Logo

When working in any of the myriad of SharePoint CAML files (*.xml) found in the 12 system folder, developers will always come to the point where they need to create a GUID. Unfortunately sometimes you need to put the curly brackets {} around the GUID in order for it to work, whatever it may be (Feature definition, site column definition, solution manifest, etc), other times you can't put the curly brackets in and the most fun of all, those times when it just doesn't matter.

One rule I like to live by is to never use the curly brackets on any GUID unless I'm working with site column definitions or references to those site columns from within a content type definition. I've been following this self guidance and advising my students of it for the last year and so far no problems! Figured I'd pass it along as I see the question come up a few times in the MSDN forums.

Yes, I know my custom commands add the {} to the content type definition… that's been fixed in an internal build that I'll share in the coming weeks.

comments powered by Disqus