I am writing a class library and referring it in a WCF Service.
In this class library , i need to get the physical path of the app.config file.
It is working when hard coded with full physical path. But, i do not want to do this way.
Please see my code:
private static void loadConfig()
{
strConfigpath = "app.config";
log4net.Config.XmlConfigurator.Configure(new FileInfo(Path.GetFullPath(strConfigpath)) );
}
I tried using Path.GetFullPath()
. But, it is giving wrong result.
I cannot use Server.MapPath()
since it is not a web service or web application.
How to do this ? Ant thoughts or suggestions ?