1

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

try_3xcept
  • 151
  • 9
  • Can you show how you try to add another StringCollection – Pierre Michel Jan 25 '21 at 18:49
  • @try_3xcept The question [here](https://stackoverflow.com/questions/1804302/where-is-the-data-for-properties-settings-default-saved) may give you some guide to use `System.Collections.Specialized.StringCollection[]` in settings. – DasiyTian_1203 Jan 26 '21 at 02:27

0 Answers0