在C#中尝试获取AD帐号信息时,会随机出现Attempted to access an unloaded appdomain的问题,解决方法如下:
将
principalContext = new PrincipalContext(ContextType.Domain)
替换为:
principalContext = new PrincipalContext(ContextType.Domain,"MYDOMAIN")
MYDOMAIN为对应的域名即可。
2022-07-10 07:33:13
在C#中尝试获取AD帐号信息时,会随机出现Attempted to access an unloaded appdomain的问题,解决方法如下:
将
principalContext = new PrincipalContext(ContextType.Domain)
替换为:
principalContext = new PrincipalContext(ContextType.Domain,"MYDOMAIN")
MYDOMAIN为对应的域名即可。