c# - Dictionary in Settings throws an exception? -


i want save dictionary in default usersettings class of project.

i've tried following in code of settings file fails:

<setting name="mediakeys" type="system.collections.objectmodel.dictionary&lt;system.input.key, system.io.fileinfo&gt;" scope="user">   <value profile="(default)" /> </setting> 

i error message when @ ui settings:

could not load file or assembly 'system.io.fileinfo>' or 1 of dependencies. parameter incorrect. (exception hresult: 0x80070057 (e_invalidarg))

bearing in mind, please, deal whole serializable dictionary @ point in time, why getting exception? non-serializable objects (such fileinfo, have tested) not throw exception.

.net settings not handle generics well. do:

[xmlroot("dictionary")] public class mydictionary : serializabledictionary<int, string> { } 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -