// Uncomment the method below to handle the event raised after a feature has been activated. public override void FeatureActivated(SPFeatureReceiverProperties properties) { SPWeb website = properties.Feature.Parent as SPWeb; FileInfo file; if (properties.Feature.TryLocateElementFile("app2.config", out file) == false) { throw new FileNotFoundException("element file file not found", "app2.config"); } foreach (KeyValueConfigurationElement appSetting in file.AppSettings()) { string fullkey = Setting.BuildWebSitePropertyKey(appSetting.Key); if (website.AllProperties.Contains(fullkey)) { website.SetProperty(fullkey, appSetting.Value); } else { website.AddProperty(fullkey, appSetting.Value); } website.Update(); } }