c# - PrincipalServerDownException on Windows XP but not on Windows 7 -
we have wpf application runs in full trust.
part of application checks membership of windows ad group.
this works fine on windows 7 machine, not on windows xp machine.
the error occurs on following line:
principalcontext ctx = new principalcontext(contexttype.domain, "domain name");
according article managing directory security principals in .net framework 3.5, "domain name" variable might not needed. is, if accessing active directory in same domain application, domain name not needed.
you use name parameter on principalcontext constructor in order provide name of specific directory connect to. can name of specific server, machine, or domain. it's important note if parameter null, accountmanagement attempt determine default machine or domain connection based on current security context.
the solution or workaround problem (at least worked me on both xp , w7) following change:
principalcontext ctx = new principalcontext(contexttype.domain, null);
Comments
Post a Comment