G
Guest
Hi,
I am facing a problem in accessing a network shared folder. I just wrote a
test console application to test the behavior and found that in some cases
the .NET does not releases the network connection after accessing the folder.
I am not instantiating object which holds the network resource, so in my
case no cleanup or dispose is required (assuming). I am just using the
Directory.Exists() static method to check whether a directory exists or not.
<CODE>
string path = @"\\systemname\test";
if(Directory.Exists(path))
Console.WriteLine("Available.");
else
Console.WriteLine("Not Available.");
</CODE>
In general this code works fine most of the time but in some cases the
connection made by .NET exceeds the maxconnection limit, and so the folder
becomes unavailable.
To reproduce this error share some folder with maxconnection limit 1 or 2.
As I am executing this code on one system so logically there should be one
connection between the two systems, even when i instantiate multiple
processes.
Please help me in understanding this behavior of .NET.
Thanks in advance.
I am facing a problem in accessing a network shared folder. I just wrote a
test console application to test the behavior and found that in some cases
the .NET does not releases the network connection after accessing the folder.
I am not instantiating object which holds the network resource, so in my
case no cleanup or dispose is required (assuming). I am just using the
Directory.Exists() static method to check whether a directory exists or not.
<CODE>
string path = @"\\systemname\test";
if(Directory.Exists(path))
Console.WriteLine("Available.");
else
Console.WriteLine("Not Available.");
</CODE>
In general this code works fine most of the time but in some cases the
connection made by .NET exceeds the maxconnection limit, and so the folder
becomes unavailable.
To reproduce this error share some folder with maxconnection limit 1 or 2.
As I am executing this code on one system so logically there should be one
connection between the two systems, even when i instantiate multiple
processes.
Please help me in understanding this behavior of .NET.
Thanks in advance.