开发者

Sharepoint bug when deactivating features

I have found that deactivating a feature in Sharepoint leaves erroneous ent开发者_运维问答ries in the AllDocs table in the content database. These table records then make deploying other features that contain the same filenames impossible as Sharepoint complains that they already exist. How can I make sure deactivating features does not leave old references in the content database?

Microsoft explicitly says that we should not execute queries directly on the database otherwise it will become unsupported.

all the best


I recall getting that error when I attempted to redeploy a feature that was not actually deleted. Perhaps you just need to go a few steps further?

stsadm -o deactivatefeature -name YourSolutionName -url  http://yoururl
stsadm -o retractsolution -name yoursolution.wsp -immediate
stsadm -o execadmsvcjobs
stsadm -o deletesolution -name yoursolution.wsp -override
stsadm -o execadmsvcjobs

EDIT: I'd also like to add my agreement that you should never attempt to modify the database directly.


Unless something goes wrong when you deactivate a feature (i.e. Unhandled exception in your FeatureDeactivated event or something similar) the features that you uninstall should not leave a trace.

I you end up with features that are still hanging on your site, I suggest using SharePoint Manager. You will be able to see everything that's installed on your Web App / Site Collection and delete the features that you don't want. All of that is done via the SharePoint object model, which means that you're never deleting anything directly from the database, and the tool works very well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜