Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Component Services / June 2005

Tip: Looking for answers? Try searching our database.

Problem with Path.GetTempFileName

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Olivier Matrot - 27 Apr 2005 13:14 GMT
I have a serviced component that is running in COM+ under a specific local
user identity. Despite the fact that the process is running in the specified
identity, Path.GetTempFileName SOMETIMES returns a filename located
%windir%\temp.
LOZANO-MORÁN, Gabriel - 27 Apr 2005 15:23 GMT
The GetTempFileName() method uses the GetTempPath() function of the
kernel32.dll and there is a search order to get the path:
 1.. The path specified by the TMP environment variable.
 2.. The path specified by the TEMP environment variable.
 3.. The path specified by the USERPROFILE environment variable.
 4.. The Windows directory.
Gabriel Lozano-Morán

> I have a serviced component that is running in COM+ under a specific local
> user identity. Despite the fact that the process is running in the specified
> identity, Path.GetTempFileName SOMETIMES returns a filename located
> %windir%\temp.
Olivier Matrot - 28 Apr 2005 16:04 GMT
I already know that. My serviced component is loading the user profile
(successfully all times). To be more specific about "SOMETIMES" in my
previous post, it seems for me that the very first time the component is
loading by COM+ after a system restart, the behavior of GetTempFileName is
incorrect. If I shut down the COM+ running process, everithing is fine when
it is restarted upon request until the next system restart.

> The GetTempFileName() method uses the GetTempPath() function of the
> kernel32.dll and there is a search order to get the path:
[quoted text clipped - 10 lines]
>> identity, Path.GetTempFileName SOMETIMES returns a filename located
>> %windir%\temp.
Gabriel Lozano-Morán - 28 Apr 2005 17:09 GMT
You could log the DirectCaller together with the temporary path

Gabriel Lozano-Morán
Olivier Matrot - 16 Jun 2005 07:37 GMT
DirectCaller is "NT AUTHORITY\NETWORK SERVICE" which is correct, because my
service component is called from a web site.
CurrentIdentity is correct as well. This is the Identity specified in the
component services properties.
Thus, I do not understand why GetTempPath or GetTempFileName returns a wrong
path as described above.

> You could log the DirectCaller together with the temporary path
>
> Gabriel Lozano-Morán

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.