The basic idea:
In a different project, create classes that will hold your custom settings. For example:
public class EndPoint
{
public string HostName { get; set; }
public int Port { get; set; }
}
public class EndPointCollection : Collection<EndPoint>
{
}
Build the project containing the classes.
Go to the Settings tab in Project Properties. It will say that there is no settings file yet and ask if you want to create it.
Add a new settings file. In the type field select Browse and type the full class name. For example: ClassLibrary.EndPointCollection. Save and rebuild the project.
Hit the edit button for the setting value. (Note that this will not be available if the classes made in the earlier step are in the same project.) Use the UI to edit the settings.

If you open the web.config / app.config file, you will see something like this:
...
<applicationSettings>
<WebApplication1.Properties.Settings>
<setting name="MyEndPoints"
serializeAs="Xml">
<value>
<ArrayOfEndPoint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<EndPoint>
<HostName>MyHostName</HostName>
<Port>12345</Port>
</EndPoint>
<EndPoint>
<HostName>MyHost1</HostName>
<Port>1212</Port>
</EndPoint>
</ArrayOfEndPoint>
</value>
</setting>
</WebApplication1.Properties.Settings>
</applicationSettings>
...
Finally, to read these sett
Here's a variation on the accepted answer, using the following user-defined class to represent a setting:
namespace MyApplication
{
public class EndPoint
{
public string HostName { get; set; }
public int Port { get; set; }
}
}
The accepted answer proposes the use of a specialised collection class, EndPointCollection to hold settings. However, I don't think this is necessary; an array type (EndPoint[]) also seems to work.
However, typing the array type in the type browser doesn't work; you can instead specify the type directly in the .settings file (using a text editor):
<Setting Name="MyEndPoints" Type="MyApplication.EndPoint[]" Scope="User">
<Value Profile="(Default)" />
</Setting>
Also, if the value editor shown in the accepted answer isn't available, you can instead type the values directly into the value field using XML:
<ArrayOfEndPoint>
<EndPoint>
<HostName>MyHostName</HostName>
<Port>12345</Port>
</EndPoint>
<EndPoint>
<HostName>MyHost1</HostName>
<Port>1212</Port>
</EndPoint>
</ArrayOfEndPoint>

Note that the XML namespace declarations that Visual Studio generates aren't necessary in the XML, as shown above.