MOSS and Site column deployment with features + missing curly brackets in guids
I had nasty expience with Site column deployment this week and I thought I share it with you. I was doing normal Site column deployment with Features. It's nothing new and it's well documented in many places. I have done it before and I thought that it would be piece of cake. So I did my Feature.xml and SiteColumns.xml like I have done before. Here's a small clip from my SiteColumns.xml in Visual Studio:
And after that I did normal install stuff with stsadm. Everything went fine during install. No errors, warnings or nothing that would indicate that I have problems in my SiteColumns.xml. But when I searched for my new site columns at the SharePoint I couldn't find any. I checked my xmls many many many times and couldn't find anything that would ring a bell on me. After a long time of testing I finally tried adding { and } curly brackets into the ID -field of the site column definition (lines 4 and 11):
And then I did my stsadm magic again... hoping for a miracle. After that I checked Site Column Gallery at the SharePoint and I was stunned when I saw my site columns! So only problem that I had in my SiteColumn.xml was missing curly brackets in the guid! It's weird since in many other places you could have guid without the curly brackets. And even if the install phase ignored my site columns for that reason I think it would be nice to see warning like this: "Cannot add field 'Account number' since it's missing ID". Ignoring something without any notice isn't nice...
But even with that kind of issue I find the Feature & Solutions thingy really nice. Deploying stuff with Features & Solutions is something you should really learn if your playing with SharePoint. They'll make your life a lot easier when you want to deploy your stuff to another environment.
Anyways... happy hacking!
J
Comments
Anonymous
February 28, 2007
Is there a way to script these out and then deploy? I have already created these using the WEB UI and would now like to port these over to the dev server. Thanks, anabhraAnonymous
February 28, 2007
Hi anabhra! Technically it's possible, but DEFINITELY it's not recommended way to work. Andrew Connell has created stsadm custom command that actually does that. Check it out here: http://www.andrewconnell.com/blog/articles/MossStsadmWcmCommands.aspx And actually I have created similar web pages (with copy snippets from Andrews example) that do the same thing. Happy hacking and hopefully Andrew's example helps you with your problem. JAnonymous
June 13, 2009
話題の小向美奈子ストリップを隠し撮り!入念なボディチェックをすり抜けて超小型カメラで撮影した神動画がアップ中!期間限定配信の衝撃的映像を見逃すな