WNetAddConnection2A - unstable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have three environments that I run my asp.net app, and all use
WNetAddConnection2A to connect to a share and copy files to folders in the
share. But once in a while, my code seems to break when I test to see if a
directory exists, and if it doesn't, it tries to create one, and fails. Bot
the Exists and Create are System.IO class methods (also the file copy...).
The problem is that the directory does exist, and normally, if it doesn't, it
does get created, but again, every so often, I get "Could not find a part of
the path "X:\"" where X is the share drive letter.
I store the drive letter in web.config, so when I change it to Y: it works,
then I change it back to X:, and it continues to work. It's like it needs a
kick-start once in a while.

I can't go live with the app until I can resolve the issue. Thanks
 
Back
Top