Re: Intermittent Incorrect Result on System.IO.Directory.Exists

Simon Robinson <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <LISTSERV%[email protected]>
On Thu, 9 Oct 2008 21:50:07 +0200, Brady Kelly <[email protected]> wrote:
>It returns false intermittently in the web app with no observably 
>changed variables.  

For something like this, I think security permissions has to be the first suspicion. If it was me I'd probably change the code to start logging the results when you try to access this directory, and at the same time log the identity that .NET thinks the request is being made from, to see if there's a pattern. I might also try accessing another directory (eg. the web root directory - surely you must have access to that :), or to a dummy directory to which Everyone has read access ) to see if the problem is directory-specific. (Actually, if you're going to log to a text file, you probably need a folder/file to which Everyone has write access anyway, so that you can successfully write the fail logs to it :-) ) 

>The number of browsers open seems to have an effect, but it is
>not identifiable as a fixed set of conditions.  

This may or may not be relevent but: If there are any memory issues in your app, then having more browsers connected may make it more likely that ASP.NET recycles your application pool - it's possible that may be having some unintended consequences.  Another point is that I do remember a while back having a problem in one of my apps where in ASP.NET security permissions weren't being picked up by worker threads that I created (I can't remember the details though, though I do remember researching it and finding that was a known behaviour). If you are doing any multithreading, that may be important.

Simon

--
Simon Robinson
http://www.simonrobinson.com

===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.