My application has the following code snippet:
if (!Directory.Exists(myPath)) Directory.CreateDirectory(myPath);
If I run it in a regular unit test, it sometimes passes, sometimes not. There is always a catalog (I was convinced of this, so technically it will never be "created" by code). But each time Directory.Exists(myPath) returned false , which causes the code to try to create a folder, and then I get a UnauthorizedAccessException !
The funny thing is, if I put a breakpoint on CreateDirectory and then move the yellow up arrow to check, the test returns true !
What's happening?
myPath is \\nameOfLocalMachine\sharedFolder . The share is reliable and constantly used .... NET 4.0
I just created a violinist that mimics 3,000 sequence requests. 175 failed ... All with the same message:
Access to path '\ nameOfLocalMachine \ sharedFolder \ randomFileName.json' denied
source share