App Directory

J

Just D.

How can we get the currently running WebApp directory? All kinds or Request.
don't work, maybe security..., the requests that work just show
C:\Windows\System32, but I need the physical path of the WebApp to adjust
some parameters in the running application after its start. I could include
the string with the absolute path into the Web.Config but it's not so
elegant and flexible and will require many corrections to the apps running
in different directories. Is there any official way to get the physical
directory where the app is located and runs from?

Just D.
 
J

Just D.

Thanks, but actually not. I have already found the answer and cancelled the
question.

It was strange for me that Request.PhysicalApplicationPath returns me the
Windows System Directory, but later I understood that it should be requested
not inside Global.asax.cs on ApplicationStart, but on the first aspx page,
so it returned me a real physical path.

Thanks anyway,
Just D.
 

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

Top