Andrew Connell [MVP MOSS]
1543 Posts |  42 Articles |  4748 Comments
.NET  |  MCMS  |  SharePoint  |  Office System
SharePoint Quick Links
Article Categories
Archives
Post Categories


Add to Technorati Favorites

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.

posted on Friday, October 26, 2007 12:06 PM

Feedback

# re: To bracket or not to bracket GUIDs in SharePoint CAML files - a general rule to live by 10/26/2007 1:26 PM John Ross
Gravatar I've experimented heavily with the bracket issue after running into it myself (not fun btw!). I've been living by your sage advice for a very long time and it has never let me down!

Also, anyone not using AC's Custom STSADM Commands -- you should be! Recently built a feature with 44 site columns in a content type. Literally took me 30 mins. Doing that same thing manually -- I don't even want to think about it. Looking forward to the updates!

-John

# re: To bracket or not to bracket GUIDs in SharePoint CAML files - a general rule to live by 1/17/2008 4:00 AM Tobias Zimmergren
Gravatar Nice tip. I got a question about this today of one of the students in the SharePoint class and I didn't know what to answer more than "do what you like". Fortunately you adviced us to use the curlybrackets for content type definitions, which is what we're doing, and it works great.
Cheers. Thanks for a good blog.

Post Feedback

Title:
Name:
Email:
(email will not be displayed)
Url:
Comments: 
Please add 8 and 5 and type the answer here:    
All Comments Are Filtered & Moderated
Unfortunately comment spammers are just too effecient and are constantly dirtying up blogs with irrelevant and unwanted comments trying to improve their standing on search engines. All comments on this blog are moderated. I do not censor comments, but I don't approve comments with vulger language or those soliciting products. Most of the time comments are approved within a few hours of being submitted with the only exception when I'm traveling.

Why are you asking for my email address?
The only reason I'm asking for your email address, which isn't required to submit a comment, is to provide a gravatar if you've created an account for yourself and associated your email address with a small image. If you have a gravatar created for the email address you submit, it will appear next to your comment. Otherwise nothing will appear.

What is a gravatar?
A gravatar is a "globally recognized avatar." You can get more information about gravatars, as well as create your own for free, at www.gravatar.com. You can also view my gravatar here.


Copyright © 2003 - 2010 Andrew Connell
Creative Commons License 
This work is licensed under a Creative Commons License
Site design by Heather Solomon.

 
 
MOSS WCM Training
Looking for MOSS 2007 WCM developer training? Look no further! I teach my 5-day hands-on and online WCM classes for developers I offer through my company: Critical Path Training.

Get more information on the WCM courses!