public static string AddFCNMode(FcnMode fcnMode) { try { // check current .net version and if attribute has been added already if (IsNet45OrNewer() && GetFcnMode() != fcnMode.ToString()) { // open the web.config var xmlConfig = Load(); var xmlhttpRunTimeKey = xmlConfig.SelectSingleNode("configuration/system.web/httpRuntime") ?? xmlConfig.SelectSingleNode("configuration/location/system.web/httpRuntime"); XmlUtils.CreateAttribute(xmlConfig, xmlhttpRunTimeKey, "fcnMode", fcnMode.ToString()); // save the web.config Save(xmlConfig); } } catch (Exception ex) { // in case of error installation shouldn't be stopped, log into log4net Logger.Error(ex); } return(string.Empty); }
public static string AddFCNMode(FcnMode fcnMode) { const string strError = ""; var xmlConfig = new XmlDocument(); try { //open the web.config xmlConfig = Load(); //check current .net version and if attribute has been added already if ((IsNet45OrNewer()) && String.IsNullOrEmpty(GetFcnMode())) { XmlNode xmlhttpRunTimeKey = xmlConfig.SelectSingleNode("configuration/system.web/httpRuntime") ?? xmlConfig.SelectSingleNode("configuration/location/system.web/httpRuntime"); XmlUtils.CreateAttribute(xmlConfig, xmlhttpRunTimeKey, "fcnMode", fcnMode.ToString()); } } catch (Exception ex) { //in case of error installation shouldn't be stopped, log into log4net Logger.Error(ex); //strError += ex.Message; } //save the web.config Save(xmlConfig); return strError; }
public static string AddFCNMode(FcnMode fcnMode) { string strError = ""; var xmlConfig = new XmlDocument(); try { //open the web.config xmlConfig = Load(); //check current .net version and if attribute has been added already if ((IsNet45OrNewer()) && String.IsNullOrEmpty(GetFcnMode())) { XmlNode xmlhttpRunTimeKey = xmlConfig.SelectSingleNode("configuration/system.web/httpRuntime") ?? xmlConfig.SelectSingleNode("configuration/location/system.web/httpRuntime"); XmlUtils.CreateAttribute(xmlConfig, xmlhttpRunTimeKey, "fcnMode", fcnMode.ToString()); } } catch (Exception ex) { //in case of error installation shouldn't be stopped, log into log4net Logger.Error(ex); //strError += ex.Message; } //save the web.config Save(xmlConfig); return(strError); }