Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stranger exception at startup

Status
Not open for further replies.

haddaway

Programmer
Jul 6, 2005
172
0
0
SE
One of my clients has a problem when starting up a Windows Service that I have created. Here is the error located in the event log:

Service cannot be started.
System.IO.DirectoryNotFoundException: Could not find a
part of the path 'C:\WINDOWS\TEMP\tidzxg8b.tmp'.
at System.IO.__Error.WinIOError(Int32 errorCode,
String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode
mode, FileAccess access, Int32 rights, Boolean
useRights, FileShare share, Int32 bufferSize,
FileOptions options, SECURITY_ATTRIBUTES secAttrs,
String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode
mode, FileAccess access)
at
System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated()
at
System.CodeDom.Compiler.TempFileCollection.AddExtension(String
fileExtension, Boolean keepFile)
at
System.CodeDom.Compiler.TempFileCollection.AddExtension(String
fileExtension)
at
Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters
options, String[] sources)
at
Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters
options, String[] sources)...

Is it some kind of problem with a dll or what should I search for? Thanks!
 
Are you writing a file or calling a file from the temp folder on startup? Did you hard code the Temp directory?
 
Are they running on Windows 2000? Because the path to temp will have c:\winnt in there instead of c:\windows.

Besides, as ralphtrent says, you should be getting the path to the temp folder out of the SpecialFolder enumeration.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
No, I have not hard coded any temp folder. But I read somewhere that .NET special folder (temp) is based on the system variables. Maybe that user has changed those variables?

The system is XP SP1.
 
Your client's account may be configured in a way that they are not allowed to access the Windows folder. You should check to see if they are an Administrator on the system and if not, check if they have any funny permissions set on the Windows folder.

Also: did you check to see if the file exists? Was it copied from a CD or Readonly media? Is the file readonly? Is the folder readonly?
 
One more idea...

If your file is created in anoter process as a temporary file and passed along to your program DO NOT forget that the temporary file is deleted on close, so the part of the path that the system wont find may be the file itself.

GUESS: Is this some kind of setup programm, because this may happen inside of them, where more child processes are spawned.

HTH,

s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top