I had some code that set the AssociatedMembersGroup in SharePoint using the Client Object Model. For whatever reason (possibly a CU recently installed), the code below no longer works:
ClientContext lClientContext = new ClientContext(vSiteURL);
lClientContext.Credentials = new NetworkCredential(Utils.APP_USERNAME, Utils.APP_PASSWORD, Utils.APP_DOMAIN);
Web lWeb = lClientContext.Web;
lClientContext.Load(lWeb, website => website.AssociatedMemberGroup, website => website.SiteGroups);
lClientContext.ExecuteQuery();
foreach (Group lGroup in lWeb.SiteGroups)
{
if (lGroup.Title == vGroupName)
{
lWeb.AssociatedMemberGroup = lGroup;
lWeb.Update();
lClientContext.ExecuteQuery();
break;
}
}
I had to change to doing this inside my create group method:
ClientContext lClientContext = new ClientContext(vSiteURL);
lClientContext.Credentials = new NetworkCredential(Utils.APP_USERNAME, Utils.APP_PASSWORD, Utils.APP_DOMAIN);
Web lWeb = lClientContext.Web;
GroupCreationInformation lGroupDef = new GroupCreationInformation();
lGroupDef.Title
…