You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.DirectoryServices.AccountManagement Version 9.0: UserPrincipal.GetAuthorizationGroups() throws System.UriFormatException: Invalid URI: The hostname could not be parsed. #109858
After updating from 8.0.1 to 9.0.0 the call above throws the following exception:
System.UriFormatException: Invalid URI: The hostname could not be parsed.
Reproduction Steps
var ctx = new PrincipalContext(ContextType.Domain);
var usersearcher = new PrincipalSearcher(new UserPrincipal(ctx));
var users = usersearcher.FindAll().Cast<UserPrincipal>();
var user = users.FirstOrDefault(e => e.SamAccountName == "valid user name");
var groupList = user?.GetAuthorizationGroups().ToList(); <== throws in 9.0.0
Expected behavior
This call should return the groups as the older versions