SharePoint: Issues with Orphans when Retracting MasterPage Feature Solution

Tag: sharepoint Author: chenchaol1 Date: 2009-07-13

When I deactivate a feature, or even just after removing a Solution package, I can still choose to select the Master Page which belonged to the feature I removed. This is a problem for me.

The only way to get rid of the hanging reference is to open SharePoint Designer and to browse to the sites _catalog directory then remove the .master files from the masterpages directory.

Is there a way to cause different uninstall behavior which would remove the hanging reference? If so how?

Thank you,

Other Answer1

Yes deactivating the Master Page feature will not remove the master page from the Site you need to do it manually or using some feature receiver code that hooks the deactivating event.

Other Answer2

My MOSS is a bit rusty, but can't you write some code in the

feature_deactivated event?

Do a manual remove of the master page there?