ASP.NET Temp directory

S

santos_sergio

Hi,


Does anyone know how to retrieve
"C:\WINDOWS\Microsoft.NET\Framework\{version}\Temporary ASP.NET Files"
directory name programmatically ?

Thanks in advance.

Sérgio Silva
 
K

Kevin Spencer

string s = @"C:\WINDOWS\Microsoft.NET\Framework\{version}\Temporary ASP.NET
Files";

--
;-),

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.


Hi,


Does anyone know how to retrieve
"C:\WINDOWS\Microsoft.NET\Framework\{version}\Temporary ASP.NET Files"
directory name programmatically ?

Thanks in advance.

Sérgio Silva
 
K

Kevin Spencer

Actually, what I meant to say was, it isn't stored somewhere, except in your
machine.config file. You could, I imagine, open the file as an XML document
and find the "tempDirectory" node under "compilation" under "system.web"
element to read it. I believe you can also override it in the web.config,
but you can't use the ConfigurationSettings class to read it. You would
still have to open it as an XML file.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.


Hi,


Does anyone know how to retrieve
"C:\WINDOWS\Microsoft.NET\Framework\{version}\Temporary ASP.NET Files"
directory name programmatically ?

Thanks in advance.

Sérgio Silva
 
T

Tampa.NET Koder

In Kevin's example you would have to hard code the {version} of the .NET
framework you want to use and/or the folder path. As a catch all situation,
you could retrieve this location where your page is being loaded from by:
System.Reflection.Assembly.GetExecutingAssembly.Location.ToString()


Hi,


Does anyone know how to retrieve
"C:\WINDOWS\Microsoft.NET\Framework\{version}\Temporary ASP.NET Files"
directory name programmatically ?

Thanks in advance.

Sérgio Silva
 
K

Kevin Spencer

Well, I've learned something today. :-D

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
S

santos_sergio

Hi,

I choose to get it from current appdomain temporary directory.

AppDomain.CurrentDomain.SetupInformation.CachePath;

The return is C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary
ASP.NET Files\2.0.0_scriptenginehost\407724a3

It's fine with me.

Thanks to all
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top