November Happy Hour will be moved to Thursday December 5th.

Read / write Host Names programmatically

Vote:
 

Hi,

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?

#151481
Jul 25, 2016 10:26
Vote:
 

Never tried it before, but you could try:

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

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

#151485
Jul 25, 2016 16:17
Vote:
 

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.

/Q

#151488
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.