Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 10, 2007 06:52 PM by convectus28
Apr 24, 2007 03:44 PM|LINK
Do you know what the solution might be to above problem. The service is checking for existence of dirs and throws an error msg assuming the dirs do not exist. I can access dirs with no problems. OS = Win2000, VB.NET 2003
Apr 24, 2007 05:17 PM|LINK
Apr 24, 2007 05:31 PM|LINK
The service is running under Administrator account. It has 2 parts: first part checks if the directories exit ( Directory.Exists command ) and it is successful. Later on, the same command fails, with the service running under the same account. This does
not make much sense. I checked the directories and both have full access.
Apr 24, 2007 06:15 PM|LINK
I don't fully understand You say it has 2 parts. First it does Directory.Exists which succeeds, then some time later after som more code has been executed it does Directory.Exists again and that call fails? Or is it the same call that fails sometimes? It's
also not clear if it consistently fails on local directories, or on remote directories or it intermittently fails on both local and remote, and sometimes works on both local and remote. Perhaps you can explain further and show some code?
Apr 24, 2007 06:22 PM|LINK
The service calls Directory.Exists twice. First time it successeds on local/remote dirs, second time it fails ( the same command, same dirs ). There is the code. I have checked , the dir is the same ( local/remote ) each time, with no spaces or anything
special. The diff is in IF
If bCheckDirExists = True Then
If Directory.Exists(ctl.Text) = False Then
Me.SetErrorMessage(ctl, friendlyName & " doesnt exist.", ErrorIconAlignment.MiddleRight)
retVal = False
retVal = True
retVal = True
If Not Directory.Exists(sHostPath) Then
WriteErrorLog("DoMonitorFolder - Host server path : " & sHostPath & " inaccessible.")
bHostAccessible = False
Apr 24, 2007 07:04 PM|LINK
Apr 24, 2007 07:25 PM|LINK
Looking at the code, it seems that the first part of the code is executed interactively, and the second part by a separate service - right? It's still not quite clear what succeeds and fails. Is the following correct?
interactively/Local directory: Succeeds
interactively/Remote directory: Succeeds
Service/Local directory: Fails
Service/Remote directory: Fails
Is the interactivity done from the service, or via a different executable?
I did find the following piece of information in the documentation for System.IO.Directory.Exists Method: The
Exists method does not perform network authentication. If you query an existing network share without being pre-authenticated, the
Exists method will return false. This would presumably only be relevant for http-connections though.
Just what is the form of the remote directory (if the problem is related to remote directories)? Is it a mapped network drive (X:\dir\dir..), a UNC path (\\server\share\....) or some other protocol?
Apr 25, 2007 03:59 PM|LINK
I believe the second part that fails is done by a different exe that is executed by service. The command fails to see the drives. What can I do for pre -authentication
Apr 25, 2007 05:43 PM|LINK
I believe the second part that fails is done by a different exe that is executed by service.
You believe? I thought you wrote the code.
Can you please try to answer the questions in my previous post one-by-one? (I do not think you need to worry about pre-authentication, let's wait a bit with that).
It's impossible to help if we can't get a question and answer protocol going.
Apr 25, 2007 05:51 PM|LINK
Just to add more info , the service runs under Administrator account and I login in using the same account