Hello,
I am getting 'Thread was being aborted - Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack' error when I use 'SPUtility.GetPrincipalsInGroup' method.
bool bReachedMaxCount = false; SPPrincipalInfo[] _spPrincInfoColl = SPUtility.GetPrincipalsInGroup(web, groupName, Int32.MaxValue - 1, out bReachedMaxCount);
We have both SharePoint groups (SPGroup) & Active Directory groups in our site.
I am checking if logged in user has access to the group name that I am passing here as 'groupName'.
Code works without any error when I pass 'domain name' as 'groupName' e.g. (Domain\\usergroup) but the same throws error when I pass SharePoint groups (SPGroup) name.
Both type of these groups have at least 'Read' permission on site.
I have this code inside 'try-catch' block and hence I am able to catch that thread aborted error.
What could be the reason for this error? I don't get any call stack and all other properties of exception object are either null or with garbage values.
I am having SP2010 foundation, VS2012 and .Net4.5 installed on my machine.
Kindly suggest on this. Thank you.
--
Sagar S.