G
Guest
Hi
We just upgraded to VS2005 but now the FileSystemWatcher no longer fires
events under ASP.NET. We use the following code (which works under 1.1):
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
private void AddFileSystemWatcher(string fileName)
{
FileSystemWatcher watcher = new FileSystemWatcher();
watcher.Path = System.IO.Path.GetDirectoryName(fileName);
watcher.Filter = System.IO.Path.GetFileName(fileName);
watcher.NotifyFilter = NotifyFilters.LastWrite;
watcher.EnableRaisingEvents = true;
watcher.Changed += new FileSystemEventHandler(watcher_Changed);
watcher.Error += new ErrorEventHandler(watcher_Error);
watcher.Disposed += new EventHandler(watcher_Disposed);
watchers.Add(watcher);
}
This code is called from within a public static method on a class that has
the private static watchers property. I have VS Studio with SP1 beta
installed and the ASP.NET project is a WebApplicationProject running under
the ASPNET account in IIS on Windows XP SP2
Thanks
We just upgraded to VS2005 but now the FileSystemWatcher no longer fires
events under ASP.NET. We use the following code (which works under 1.1):
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
private void AddFileSystemWatcher(string fileName)
{
FileSystemWatcher watcher = new FileSystemWatcher();
watcher.Path = System.IO.Path.GetDirectoryName(fileName);
watcher.Filter = System.IO.Path.GetFileName(fileName);
watcher.NotifyFilter = NotifyFilters.LastWrite;
watcher.EnableRaisingEvents = true;
watcher.Changed += new FileSystemEventHandler(watcher_Changed);
watcher.Error += new ErrorEventHandler(watcher_Error);
watcher.Disposed += new EventHandler(watcher_Disposed);
watchers.Add(watcher);
}
This code is called from within a public static method on a class that has
the private static watchers property. I have VS Studio with SP1 beta
installed and the ASP.NET project is a WebApplicationProject running under
the ASPNET account in IIS on Windows XP SP2
Thanks