Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

SPUtility.GetPrincipalsInGroup method throws Thread was being aborted error when SPGroup Name is passed

$
0
0

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.



Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>