1
List<string> directories = new List<string>() { rootSkinFolder };
directories.AddRange(Directory.GetDirectories(rootSkinFolder));
CacheItemPolicy policy = new CacheItemPolicy();
policy.ChangeMonitors.Add(new HostFileChangeMonitor(directories));
policy.Priority = System.Runtime.Caching.CacheItemPriority.Default;
MemoryCache.Default.Set(cachePath, resultPath, policy);

I have code as above, but I am getting the error:

The UTC time represented when the offset is applied must be between year 0 and 10,000.

Please let me know what setting needs to be done to fix this error.

jarlh
  • 42,561
  • 8
  • 45
  • 63
  • Does this answer your question? [Using MemoryCache with HostFileChangeMonitor init to a directory gets ArgumentOutOfRangeException](https://stackoverflow.com/questions/11798498/using-memorycache-with-hostfilechangemonitor-init-to-a-directory-gets-argumentou) – Vladislav Aug 26 '20 at 09:20

1 Answers1

1

Try to look at https://support.microsoft.com/en-us/kb/2346777. It could help with your problem.

Nogard
  • 36
  • 4