Getting Application Path Physical location

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?
 
M

Mark Monster

Hello Raed,

The temporary folder is not that strange at all. Every aspx and ascx file
will be compiled to source-code. The compiled code will be in the temporary
directory.

I'm not sure what you should do to get the aspnet application physical path.

Regards,

Mark Monster
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top