在C#中尝试获取AD帐号信息时,会随机出现Attempted to access an unloaded appdomain的问题,解决方法如下:
将
principalContext = new PrincipalContext(ContextType.Domain)
替换为:
principalContext = new PrincipalContext(ContextType.Domain,"MYDOMAIN")
MYDOMAIN为对应的域名即可。
在C#中尝试获取AD帐号信息时,会随机出现Attempted to access an unloaded appdomain的问题,解决方法如下:
将
principalContext = new PrincipalContext(ContextType.Domain)
替换为:
principalContext = new PrincipalContext(ContextType.Domain,"MYDOMAIN")
MYDOMAIN为对应的域名即可。
转载于:https://www.cnblogs.com/ilovewindy/p/5957101.html