private void AddNewWebRole(ServiceDefinition sd, WebRole newWebRole) { int count = (sd.WebRole == null) ? 0 : sd.WebRole.Length; WebRole[] webRoles = new WebRole[count + 1]; if (count > 0) { sd.WebRole.CopyTo(webRoles, 0); } webRoles[count] = newWebRole; sd.WebRole = webRoles; }
//Setting == CSCFG Settings private void GetWebRoleCSDEF(string webRoleName, ref int webRoleOccurrence, out WebRole webRole) { XmlSerializer xmlSerializer = new XmlSerializer(typeof(ServiceDefinition)); Assembly assembly = Assembly.GetExecutingAssembly(); Stream stream = assembly.GetManifestResourceStream(ResourceName.WebRoleTemplate); webRole = ((ServiceDefinition)xmlSerializer.Deserialize(stream)).WebRole[0]; stream.Close(); webRole.name = webRoleName; webRoleOccurrence++; }