FileSystemWatcher not working in Smart Client

G

Guest

I have created a simple smart client that downloads some xml and puts it into
a document on the client machine. It then launches the default editor for xml
documents (using the Process class and setting the process.StartInfo.Verb =
"Edit"). It then creates a FileSystemWatcher to watch the file and check for
changes (the idea being that it will be able to upload changes back to the
web server). When launched from within Visual Studio 2005, everything works
as expected. However, when launched by downloading the app from a web
browser, the file is created and the default editor launched, but the
FileSystemWatcher does not trigger any events. No errors, no exceptions, it
just doesn't do anything. Are there any known issues with using the
FileSystemWatcher with Smart Clients that might be causing this? Any other
ideas?

The Smart Client has full permission on the client machine, so I don't think
that this can be the problem.
 
J

JezB

I have this problem too, but I noticed it only fails the FIRST time I add
files to a folder being watched. Second time, it does fire. Odd. I don't
have a solution though I'm afraid.
 
G

Guest

Thanks for the reply. I don't even get that functionality; it just refuses to
pick up any new files/changes to existing files when running as a Smart
Client, no matter how many I make :-(
 
G

Guest

Have finally figured it out.

I was using the FileSystemWatcher to monitor "C:\", but for some reason,
when run as a Smart Client, it thought that "C:\" equated to the directory
that it had been downloaded to and run from. Specifying the directory using
UNC notation (\\<machinename>\c$) meant that it watches the correct directory
both when run directly and as a Smart Client.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top