Sharepoint 功能升级是否应该使用最新的属性值?

Sharepoint 功能升级是否应该使用最新的属性值?,sharepoint,sharepoint-2010,Sharepoint,Sharepoint 2010,我的功能的Template.xml文件的1.0.0.0版本如下所示: <?xml version="1.0" encoding="utf-8" ?> <Feature xmlns="http://schemas.microsoft.com/sharepoint/"> <Properties> <Property Key="AvailableWebTemplates" Value="MPS#0;MPS#1;MPS#2;MPS#3;MPS#4"

我的功能的Template.xml文件的1.0.0.0版本如下所示:

<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/">
  <Properties>
    <Property Key="AvailableWebTemplates" Value="MPS#0;MPS#1;MPS#2;MPS#3;MPS#4" />
  </Properties>
</Feature>

为什么我没有得到更新的属性值?这是应该的方式吗?

这确实是应该的方式: 一个要素有1个定义和n个实例。FeatureUpgrading中的代码用于升级实例

xml中的属性将更新功能定义,而不是正在运行的实例


properties.Feature.properties[“MyProp”]
获取运行实例的属性值
properties.Definition.properties[“MyProp”]
获取功能定义中的属性值。

。所以我想,因为这是FeatureUpgrading而不是FeatureUpgraded,所以我有机会将实例与定义进行比较,看看有什么不同。我最初是如何将参数部分添加到CustomUpgradeAction的。我还没决定是否喜欢。我想如果有多个版本,参数中的值将为我提供功能升级的历史记录。但是我已经有了源代码管理,它告诉我这一点,所以我想我会把它去掉,然后使用properties.Definition。谢谢
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/">
 <UpgradeActions>
  <VersionRange BeginVersion="1.0.0.0" EndVersion="1.1.0.0">
   <CustomUpgradeAction Name="UpgradeTo1v1"/>
  </VersionRange>
 </UpgradeActions>
  <Properties>
    <Property Key="AvailableWebTemplates" Value="MPS#0;MPS#1;MPS#2;MPS#3;MPS#4;STS#2" />
  </Properties>
</Feature>
SPFeatureProperty property = properties.Feature.Properties["AvailableWebTemplates"];
string templates = property.Value;