G
Guest
I have a problem in getting asp.net application physical path in global.ascx
static function
in my global.ascx i have a static function :
first i tried to get the physical path by refelection using
string rootPath =
Path.GetDirectoryName(System.Refelection.Assmebly.GetExecutingAssembly().Location);
but the problem it returned a path in temprary folder in
/winnt/framework/ver/temporay asp.net files ..i do not know why?
then i tried Server.MapPath but exception occured with following message
System.Web.HttpException: Server operation is not available in this context.
what should I do to get aspnet application physical path?
static function
in my global.ascx i have a static function :
first i tried to get the physical path by refelection using
string rootPath =
Path.GetDirectoryName(System.Refelection.Assmebly.GetExecutingAssembly().Location);
but the problem it returned a path in temprary folder in
/winnt/framework/ver/temporay asp.net files ..i do not know why?
then i tried Server.MapPath but exception occured with following message
System.Web.HttpException: Server operation is not available in this context.
what should I do to get aspnet application physical path?