Blog Stats
  • Posts - 17
  • Articles - 2
  • Comments - 16
  • Trackbacks - 1

 

TO Get the App.Config file from another Assembly

public

{

 

 

fName +=

 

xDoc.Load(fName);

 

 

 

}

static string GetAppConfig(string key)string fName = Assembly.GetExecutingAssembly().Location.Substring(0,Assembly.GetExecutingAssembly().Location.LastIndexOf("\\"));"\\MyApp.exe.config";XmlDocument xDoc = new XmlDocument();XmlNode xNode = xDoc.SelectSingleNode("/configuration/appSettings");XmlNode keyNode = xNode.SelectSingleNode(string.Format("//add[@key='{0}']", key));return keyNode.Attributes["value"].Value;

Feedback

No comments posted yet.


Post a comment





 

 

 

Copyright © Shailen Sukul