Код: Выделить всё
System.IO.FileNotFoundException: The network path was not found.
at System.DirectoryServices.AccountManagement.UnsafeNativeMethods.IADs.Get(String bstrName)
at System.DirectoryServices.AccountManagement.CredentialValidator.BindSam(String target, String userName, String password)
at System.DirectoryServices.AccountManagement.CredentialValidator.Validate(String userName, String password, ContextOptions connectionMethod)
at System.DirectoryServices.AccountManagement.PrincipalContext.ValidateCredentials(String userName, String password, ContextOptions options)
at CheckMemberStep(String& username, String password)
Код: Выделить всё
using (var context = new PrincipalContext(currentContextType))
{
step.IsReady = context.ValidateCredentials(user, password, ContextOptions.Negotiate);
}
Машина — 64-разрядная версия Win server 2016
.Net версии 4.6.2
Это приложение WPF. Контекст задается как ContextType.Machine. Пользователь входа — это пользователь, запускающий приложение.
Подробнее здесь: https://stackoverflow.com/questions/788 ... erver-2016