Question: I am trying to develop a proof of concept WCF web service which uses the FileSystemWatcher class to listen to a directory and simply outputs the type of change and the full path of files which are changed.

I have a sample console application which works as expected but when I port this into a WCF library the event handler for file changes never fires.

Code:

```
    public void MonitorFolder()
    {
        System.IO.FileSystemWatcher watcher = new System.IO.FileSystemWatcher();
        watcher.Path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "folder-to-watch");
        watcher.IncludeSubdirectories = false;
        watcher.Changed += watcher_Changed;
        watcher.Filter = "*.*";
        watcher.NotifyFilter = NotifyFilters.LastAccess |
                     NotifyFilters.LastWrite |
                     NotifyFilters.FileName |
                     NotifyFilters.DirectoryName;
        watcher.EnableRaisingEvents = true;
    }

    void watcher_Changed(object sender, System.IO.FileSystemEventArgs e)
    {
        Console.WriteLine(string.Format("Change: {0}, File: {1}", e.ChangeType, e.FullPath));
    }

```

And inside the client class which calls the service:

```
    static void Main(string[] args)
    {
        FileListenerClient c = new FileListenerClient();
        c.MonitorFolder();
        c.Close();
    }

```

Any ideas why this does not pick up file changes?

Answer: 
`Environment.SpecialFolder.Desktop` means desktop of current user. 

If your service stars under `LocalSystem` account (or similar), then it monitors its own desktop, not the desktop of current interactive user, where you're changing files or folders. 

Of course, desktop of service account remains unchanged, thus, event doesn't fire.
Assuming a) the behaviour you have detailed is what you want and b) you are watching the correct folder, have you looked at the fairly well known issues with InternalBufferSize and FileSystemWatcher?

Have a read of this <http://social.msdn.microsoft.com/Forums/vstudio/en-US/4465cafb-f4ed-434f-89d8-c85ced6ffaa8/filesystemwatcher-reliability>