Hi,
I'm trying to add entry in web.config using below code
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPWebService newService = SPWebService.ContentService;
SPWebConfigModification customModification = new SPWebConfigModification();
customModification.Path = "configuration/system.web";
customModification.Name = "browserCaps";
customModification.Sequence = 0;
customModification.Owner = "UserName";
customModification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;
customModification.Value = "<browserCaps></browserCaps>";
newService.WebConfigModifications.Add(customModification);
newService.Update();
newService.ApplyWebConfigModifications();
SPWebConfigModification customModification1 = new SPWebConfigModification();
customModification1.Path = "configuration/system.web/browserCaps";
customModification1.Name = "result";
customModification1.Sequence = 0;
customModification1.Owner = "UserName";
customModification1.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;
customModification1.Value = "<result type='System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'/><filter>isMobileDevice=false</filter>";
newService.WebConfigModifications.Add(customModification1);
newService.Update();
newService.ApplyWebConfigModifications();
}
I'm getting "Error occurred in deployment step 'Activate Features': '' is an invalid expression."
I'm I doing anything wrong here? please help.