I put a web part on a page through a feature.
I deactivate the feature.
Then when I go to activate it again, i loop through the wpManager.WebParts to determine if it is already on the page
using (SPLimitedWebPartManager wpManager = site.GetLimitedWebPartManager(url + page, System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared)) {
try {
SPLimitedWebPartCollection existingParts = wpManager.WebParts;
//I loop through checking to see if it is on the page) here
...
If I manually activate/deactivate it all works fine. The problem occurs when I activate the feature from another feature. Yes, I have one feature that acts as a wrapper which then activates other features in a particular order. Well, when activating this wrapper and doing the loop above the existingParts.Count = 0
I cannot explain this behavior. Ideas?