title: Sharepoint: SPweb.Groups.GetByName(groupName) throwing exception
body: <p>I am trying to create a new SharePoint group programmatically (using .Net), for this I am using the following C# code</p>
  
  <pre><code>                //greate group with no users:
  
                  web.SiteGroups.Add(groupName, groupOwner, null, description);
                  //Parameters are defined earlier in the code such as:
                  //   string groupName
                  //   SPUser groupOwner
                  //   string description
  
                  web.Update();
                  SPGroup newGroup = web.Groups.GetByName(groupName);
  </code></pre>
  
  <p>The creation works well but when I try to access the group an exception is thrown saying "Group cannot be found."
  What is the reason that the group can not be found and how can I fix this (I need to access the group for my further code)? If I check on the SharePoint  under People and Groups the group is there.</p>
  
  <p>Any help is appreciated, thanks.</p>