您的位置:首页 > 产品设计 > UI/UE

转载 使用Feature的方式部署Site column时, Field的Guid上忽略大括号将导致部署失败

2010-04-21 00:10 453 查看
今天看到一篇老外的文章不错,转载下来,作个记录。

文章的大意是:使用Feature的方式部署Site column时, xml文件中的Field结点的ID属性值,由于忽略大括号(如图一),导致部署时,一切正常,没有任何错误信息,但是却没有真正的部署成功。给ID的属性值加了大括号后(如图二)就OK了。

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!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐