In my settings file, I would like to have one setting that is of the type List(of Myclass)…. I can't find anything on the net that does this. Is it possible?
.net – Can you have a generic List(of T) in your settings file
.netapp-configgenerics
Related Question
- C# – What are the correct version numbers for C#
- C# – Path.Combine for URLs
- Java – How to create a generic array in Java
- C# – Proper use of the IDisposable interface
- C# – How to get the type of T from a member of a generic class or method
- C# – How to remedy “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning
- C# – How to Sort a List
by a property in the object - C# – Why not inherit from List
Best Solution
I agree that Meta-Knight's inheritance solution is best, however it is possible to do this by manually editing the setting XML file. In Solution Explorer go to: Solution > Project > Properties > Settings.settings. Right-click on Settings.settings and choose "Open With". Select "XML (Text) Editor". Then insert the following inside
<Settings>
:save, and it works.
Unfortunately it doesn't appear to work with generic types requiring two or more types, since the comma is not allowed in that attribute. Even entity-encoding it (
,
) didn't help.The following causes an error "Illegal characters in path" when you go to edit the settings file in the settings designer: