Hi, I have an web application. I am lossing sessions and static variables become null if i use the following code in my application.
public string _xmlfilepath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Code\\Culture.xml");
public string _userfilepath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Users");
Even when i am using this code...the sessions are lost
_userfilepath = Request.PhysicalApplicationPath + "Users\\";
_xmlfilepath = Request.PhysicalApplicationPath + "App_Code\\Culture.xml";
If i use this code then its working fine. Adding paths in web.config
<add key="UserPath" value="F:\MyFolder\Users\" />
<add key="CultureXML" value="F:\MyFolder\Admin\Culture.xml" />
Later i am retirving those paths in application
public string _userfilepath = ConfigurationManager.AppSettings["UserPath"];
public string _xmlfilepath = ConfigurationManager.AppSettings["CultureXML"];
But I dont know the drive names etc at client location to place my application. If i use the appdomain code then where ever this code placed the files will create in that directory itself. But the problem is i am loosing sessions and static variables becoming null. Due to this exceptions are arising. How can i overcome this issue?
G. Satish