Read / write Host Names programmatically



As our list of Host Names managed in the Admin -> Config -> Edit Websites screen is growing we would like to be able to read / write this list programmatically. Is there a way to do so?

Jul 25, 2016 10:26

Never tried it before, but you could try:

SiteDefinition.Current.Hosts.Add(new HostDefinition() { .... });
Jul 25, 2016 10:53

Thanks. However the SiteDefinition.Current.Hosts List is read only.

Jul 25, 2016 16:17

If you just want to add or remove HostDefinition to Hosts, it should work

If you want to set value of Hosts, you must call CreateWritableClone() to create a writable instance.


Jul 25, 2016 16:42
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.