i need some help with the settings function of c#.
I have a tool which calculates dilutions of samples based on given target concentration and volume and source concentrations.
The information about the target volumes depends on the kit which will be used. These kits shall be stored in an array of stringcollections, wherein one stringCollections holds all values(name, volumes, concentrations...) for one kit.
The reason why i want to use an array of stringCollections is, that the user shall have the option to add more kits on runtime. Therefore i could just append a new stringCollection to the array and build my dropdown entries by iterating over the array and get all names of the defined kits.
When i define a new setting in the Settings.settings file like this:
<Setting Name="allKitsArray" Type="System.Collections.Specialized.StringCollection[]" Scope="User">
<Value Profile="(Default)" />
</Setting>
i can access it in the Settings Window in VisualStudio but when i try to add a new StringCollection it gives me the error, that System.String has no Constructor method.
I hope the problem is clear otherwise i would be happy if you could point out the missing informations you need.
Update
@Pierre Michel I try to add them in the Project Properties -> Settings
(see Error Message from Visual Studio)
As you can see adding to the array is no problem, but when the second editor opens and i try to add a string collection, i get the error message with no constructor for string
question from:
https://stackoverflow.com/questions/65884949/use-an-array-of-stringcollection-in-c-sharp-settings 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…