'PrincipalContext works only with server defined
At work I am getting a new computer, and I have problems with PrincipalContext:
PrincipalContext principalContext = new PrincipalContext(ContextType.Domain);
This give the errors:
The server could not be contacted. Inner exception: The LDAP server is unavailable.
Adding our domain to the call fixes the issue:
PrincipalContext principalContext = new PrincipalContext(ContextType.Domain, "our_domain.com");
Why is the domain needed now? I still work the same place and the setup of my new computer should be the same.
Both have Win 10 Enterprise, though the old computer has version 20H2 and the new 21H1. On my old computer I used Visual Studio 2019, on the new I moved to Visual Studio 2022. The application use .Net 4.7.2 on both computers
What could cause this difference?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|