First off, thanks for all of your advice.
I changed the folder settings, and ASPNET is authorized to write to that
directory.
Path.GetTempPath() returns: C:\DOCUME~1\ATCS\ASPNET\LOCALS~1\Temp\
But, Path.GetTempFileName() still returns an Error, I pasted the info
below.
The directory name is invalid.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.IO.IOException: The directory name is invalid.
Source Error:
Line 1847: // Get a temporary system filename
Line 1848: lFile = Path.GetTempPath();
Line 1849: lFile = Path.GetTempFileName();
Line 1850: File.Delete(lFile);
Line 1851: lPath = Path.GetPathRoot(lFile);
Source File: c:\development\visual studio
projects\system\utilities\utilities.cs Line: 1849
Stack Trace:
[IOException: The directory name is invalid.]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +723
System.IO.Path.GetTempFileName() +90
System.Utility.Utilities.GetFilename(String Prefix, String Extention,
Boolean AddDateStamp, Boolean AddTimeStamp) in c:\development\visual
studio projects\system\utilities\utilities.cs:1849
System.Utility.Utilities.GetFilename() in c:\development\visual studio
projects\system\utilities\utilities.cs:1799
System.Utility.TextFile.initializeClass(String File) in
C:\Development\Visual Studio Projects\System\Utilities\TextFile.cs:190
System.Utility.TextFile..ctor() in C:\Development\Visual Studio
Projects\System\Utilities\TextFile.cs:126
System.Utility.LogFile..ctor(String File) in C:\Development\Visual
Studio Projects\System\Utilities\LogFile.cs:75
System.Utility.TraceDebugListener..ctor(String Type) in
C:\Development\Visual Studio
Projects\System\Utilities\TraceDebugListener.cs:82
System.Utility.ListenerDebug..ctor() in C:\Development\Visual Studio
Projects\System\Utilities\ListenerDebug.cs:10
eRMS.Global.Session_Start(Object sender, EventArgs e) in
c:\inetpub\wwwroot\eRMSTest_NET\Global.asax.cs:73
System.Web.SessionState.SessionStateModule.RaiseOnStart(EventArgs e)
System.Web.SessionState.SessionStateModule.OnStart(EventArgs e)
System.Web.SessionState.SessionStateModule.CompleteAcquireState()
System.Web.SessionState.SessionStateModule.BeginAcquireState(Object
source, EventArgs e, AsyncCallback cb, Object extraData)
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +173
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET Version:1.1.4322.573
Again, thanks for all of your help.
Jerry said:
You need to disable Simple file sharing under Folder Options to be able
to set permissions in WinXP.
If the ASPNET's temp directory is set to a valid path then I don't know
what might be causing the problem.
Jerry
The system environment Temp and Tmp are both set to "C:\WINDOWS\TEMP".
I'm running XP Professional. My user has Temp and Tmp set to:
%USERPROFILE%\Local Settings\Temp.
The Path.GetTempPath is showing the ASPNET user Local Temp.
In windows XP there doesn't seem to any place to specificaly set folder
permissions as in 2000 or 2003 Server for an individual user.
Jerry Pisk wrote:
Most likely it would be the ASPNET user. I'm not sure how to set that
user's environment (without writing code) but first check what the temp
directory is, Path.GetTempPath(). Check if the name is valid and the
directory exists and that ASPNET can write into it (but i think you'd
get a different exception if it was a permission issue).
Jerry
Wouldn't that be the ASPNET user?
If so how do I set the environment for that User?
Jerry Pisk wrote:
Because your TEMP or TMP environment variable (for your web site's
account) is an invalid directory name?
Jerry
Why am I receiving the below error when calling -
Path.GetTempFileName()
The directory name is invalid.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.IO.IOException: The directory name is
invalid.