The VSTA debugger has... well... bugs in it. For example, string interpolation is not supported and will prevent the debugger from launching. That is mitigated by using String.Format();
. However, I have found another bug that I cannot seem to get around and that is using TryGetValue()
on a dictionary. The below code prevents the debugger from launching:
foreach (string strMemberDn in varGroupMemberDns)
{
if (dctObjectGuidDn.TryGetValue(strMemberDn, out Guid gidMemberGuid))
{
lstGroupMemberGuid.Add(gidMemberGuid);
}
}
Currently, I have to use the following if I want to debug the script, or I have to comment out the above section.
foreach (string strMemberDn in varGroupMemberDns)
{
lstGroupMemberGuid.Add(dctObjectGuidDn[strMemberDn]);
}
Is there a workaround for this problem?