You cannot get SPContext inside handlers - this is by design. You must use the event properties passed as an argument to the handler to get a link to the current network, list item, etc. For example, in an activated component handler, you can do this as follows:
public override void FeatureActivated(SPFeatureReceiverProperties properties) { SPWeb web = properties.Feature.Parent as SPWeb;
If the feature area is a site, then
public override void FeatureActivated(SPFeatureReceiverProperties properties) { SPSite site = properties.Feature.Parent as SPSite;
Ivan Vagunin
source share