zoukankan      html  css  js  c++  java
  • 转载 使用Feature的方式部署Site column时, Field的Guid上忽略大括号将导致部署失败

    今天看到一篇老外的文章不错,转载下来,作个记录。

    文章的大意是:使用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:
    1
    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):
    2
    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!

  • 相关阅读:
    hdu 4849 Wow! Such City! 简单最短路
    hdu 4856 Tunnels BFS+不回起点的TSP
    django框架之中间件 Auth模块
    django框架之Ajax,自定义分页器...
    django框架之模板层
    django框架之路由层 视图层......
    Django框架之初识
    前端之JavaScript
    项目问题笔记汇总
    最简英语语法
  • 原文地址:https://www.cnblogs.com/ITHelper/p/1716736.html
Copyright © 2011-2022 走看看