Tuesday, May 31, 2005

CacheDependency Limitation


As of ASP.NET 1.1, it looks like you can only get an ASP.NET cache item
to be dependent on about about 40 remote directories or so, then you'll run
into an arbitrary limitation of the ReadDirectoryChangesW win32 api
call. The exception generated will look something like this:

Failed to start monitoring changes to '\\Your\remote\directory'.


I doubt that this will be fixed in ASP.NET 2.0, since it is really a
limitation of the underlying OS.


This issue is especially ugly when you have to monitor a large number
of directories, such as an entire directory tree. It would be
nice if CacheDependency would allow you to monitor a deep directory --
that is, monitor if any changes were made to any file within an entire
tree structure. My guess is that this is just something the OS
does -- it would be a nice addition.


Supporting URLs:


http://groups-beta.google.com/group/microsoft.public.dotnet.framework.aspnet/msg/fda128472edbf215?hl=en

http://www.vsj.co.uk/dotnet/display.asp?id=381
(See the box titled "Under the Hood of the ASP CacheDependency" at the
bottom of the article)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/readdirectorychangesw.asp
(ReadDirectoryChangesW fails with ERROR_INVALID_PARAMETER...)

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?