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
Thanks
It is not the big things you say it is the little things you do.
Does the user the service is running under have the appropriate permissions? You might want to add logging or tracing to your code so you can follow what happens more easily.
Svante
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com [Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
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.
Thanks
It is not the big things you say it is the little things you do.
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?
Svante
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com [Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
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
Else
retVal = True
End If
Else
retVal = True
End If
Success
If Not Directory.Exists(sHostPath) Then
WriteErrorLog("DoMonitorFolder - Host server path : " & sHostPath & " inaccessible.")
bHostAccessible = False
End If
Failure
It is not the big things you say it is the little things you do.
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?
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?
Svante
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com [Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
Marked as answer by convectus28 on Aug 28, 2007 12:43 PM
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
Thanks
It is not the big things you say it is the little things you do.
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.
Svante
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com [Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
convectus28
Member
7 Points
47 Posts
VB.NET service does not see remote/local directories
Apr 24, 2007 03:44 PM|LINK
Hello all
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
Thanks
Svante
All-Star
18347 Points
2300 Posts
Re: VB.NET service does not see remote/local directories
Apr 24, 2007 05:17 PM|LINK
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com
[Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
convectus28
Member
7 Points
47 Posts
Re: VB.NET service does not see remote/local directories
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.
Thanks
Svante
All-Star
18347 Points
2300 Posts
Re: VB.NET service does not see remote/local directories
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?
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com
[Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
convectus28
Member
7 Points
47 Posts
Re: VB.NET service does not see remote/local directories
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
Else
retVal = True
End If
Else
retVal = True
End If
Success
If Not Directory.Exists(sHostPath) Then
WriteErrorLog("DoMonitorFolder - Host server path : " & sHostPath & " inaccessible.")
bHostAccessible = False
End If
Failure
convectus28
Member
7 Points
47 Posts
Re: VB.NET service does not see remote/local directories
Apr 24, 2007 07:04 PM|LINK
Svante
All-Star
18347 Points
2300 Posts
Re: VB.NET service does not see remote/local directories
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?
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com
[Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
convectus28
Member
7 Points
47 Posts
Re: VB.NET service does not see remote/local directories
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
Thanks
Svante
All-Star
18347 Points
2300 Posts
Re: VB.NET service does not see remote/local directories
Apr 25, 2007 05:43 PM|LINK
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.
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com
[Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
convectus28
Member
7 Points
47 Posts
Re: VB.NET service does not see remote/local directories
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