Upgrading features: List definitions are added but not list instances
-
13-02-2021 - |
質問
I want to be able to add new list definitions and list instances to a solution by adding these to an existing feature. When I add the new items to the feature, update the version number and run Update-SPSolution
I can see that the new list definition is installed. Then I do the feature.Upgrade($false) in the right site in Powershell and I can see that the feature is updated but the new list instances are not added.
Should it be possible to add new list instances like this? Or do I have to write custom logic in the feature event receiver to do this manually?
解決
Just to upgrade the feature is not going to to it, I had to specify the addition of elements on upgrade explicitly in the feature manifest like this:
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/">
<UpgradeActions>
<VersionRange BeginVersion="1.0.0.0" EndVersion="1.0.0.1">
<ApplyElementManifests>
<ElementManifest Location="TestListInstance\Elements.xml" />
</ApplyElementManifests>
</VersionRange>
</UpgradeActions>
</Feature>
所属していません sharepoint.stackexchange