SPGroupCollection.GetByID will throw an SPException for nonexistent Groups

This is just a reminder for myself because I keep forgetting it:

Calling SPGroupCollection.GetByID will throw an SPException if the Group was not found.

Comments (1)

Mohamed HachemJanuary 25th, 2011 at 18:22

Hello
What was happening is the following as of lot of errors in sharepoint they are not very descriptive “Group cannot be found” mean that group had no permission within site, to be accessible the group should have at least read permission within the site.
So if you create new group or your using group with no access, you will have the error
Resolution :
Give permission to your group on the site 😉
Cheers