I've a strange problem with activating a feature from C#: I have a list with a event receiver attached, which creates a new sub-site every time a new listitem has been added:
var newWeb = subSites.Add(SPEncode.HtmlEncode(abkuerzung), firmierung, "", cid, "STS#1", false, false);
After creation of the sub-site, which works as expected, i try to activate a custom feature, which is installed on the root web:
newWeb.Features.Add(new Guid("{4017e2cf-5be6-4fb2-9e8a-a176188eb3ca}"), false, SPFeatureDefinitionScope.Site);
The problem is, that the event FeatureActivated does not execute. It will execute, if i activate the feature from the site settings, but not from my code. I checked the Guid, changed the bool which forces the feature to be activated even on errors, but the code inside my event will not be executed.
Any idea will be helpful...