Andrew Connell

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

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. Technorati tags: sharepoint, wss, sharepoint features, moss...

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 commandsadd the {} to the content type definition… that’s been fixed in an internal build that I’ll share in the coming weeks.

Andrew Connell
Founder & Chief Course Artisan, Voitanos LLC. | Microsoft MVP
Written by Andrew Connell

Andrew Connell is a web developer with a focus on Microsoft Azure & Microsoft 365. He’s received Microsoft’s MVP award every year since 2005 and has helped thousands of developers through the various courses he’s authored & taught. Andrew’s the founder of Voitanos and is dedicated to delivering industry-leading on-demand video training to professional developers. He lives with his wife & two kids in Florida.