Bug in FileCache

Jun 19, 2012 at 5:10 PM

If a non zero cacheExpireTime TimeSpan is specified then this will cause the Exists method to return false on tiles that have expired. This should mean that the tile can be replaced in the cache with a new one when Add is called. However, the Exists method never deletes expired tile files. When WriteToFile is called it will fail (and throw an IOException) to create the new file because it already exists. The result is missing tiles.


Simple. Change FileMode.CreateNew to FileMode.Create in the WriteToFile method.

Jun 19, 2012 at 6:49 PM
Edited Jun 19, 2012 at 6:50 PM

Thanks for the report. In fact this bug was already reported by petlot and it is now fixed as you suggested in the repo but not in the release yet.