public override void FeatureActivated(SPFeatureReceiverProperties properties) { var siteCollection = (SPSite)properties.Feature.Parent; var environment = new Environment(siteCollection); if (String.IsNullOrEmpty(environment.RawMode)) environment.Update(EnvironmentMode.Development); }