I am trying to write logic to save a file to a local drive in Silverlight 4.0. For this I use a class SaveFileDialog. It is working fine. But when I try to save a file that is already open for viewing, I get an unhandled exception. Also, the application will work immediately.
A similar problem arose with Silverlight 3. There I got rid of the problem by swallowing an exception, searching the text SaveFileStreamfor exceptions, in the application_unhandledexception event. I thought this would be handled in Silverlight 4, but now it's getting worse. Even a workaround now does not work.
I put a try catch around the logic SaveFileDialog, and IOException(another process uses the file) is safely caught here, but the exception described above is immediately raised.
Any help would be appreciated.
Update: this happens with excel files and does not happen with txt files. I would think that this will happen for all MS Office files.
Reporting a problem in the official forum
source
share