By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,494 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,494 IT Pros & Developers. It's quick & easy.

XmlSerializer / Temp directory / System shutdown

P: n/a
My application has a settings class that is serialized to save and
deserialized to load. I'm having a problem where i catch the
WM_QUERYENDSESSION event via WinProc to save my application's settings when
a user logs out, reboots or shuts down the system.

The behavior of XmlSerializer is that it creates temporary dll's to do the
(de)serialization in the system's temp directory.

The behavior of windows on a system shutdown is to purge these temporary
files from the system's temp directory.

The problem i'm having is that i am unable to serialize my settings class
when the system is shutting down, because windows is purging these temporary

Is there a way to control the directory where the XmlSerializer creates the
temporary files (other than changing the TEMP environmental variable, which
isn't an option for me), or is there another means of serialization i can
use which bypasses the temporary file creation step?

My settings class has hundreds (potentially thousands) of things getting
saved to a file. Manually serializing/deserializing would be a real pain
that i am hoping i can avoid. This seems to be a big flaw in the .net
xmlserialization implementation. :(
Nov 22 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.