Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AD lookup of GetGroup will return exception after migration to .net 9 #109911

Closed
tornie2 opened this issue Nov 18, 2024 · 3 comments
Closed

AD lookup of GetGroup will return exception after migration to .net 9 #109911

tornie2 opened this issue Nov 18, 2024 · 3 comments

Comments

@tornie2
Copy link

tornie2 commented Nov 18, 2024

Description

We are using AD on premises as identity system on Windows machines
After migrating to .net 9 we see exceptions in lookup of roles in AD

Invalid URI: The hostname could not be parsed.'

Reproduction Steps

These 4 lines will recreate the problem

using var domain = new PrincipalContext(ContextType.Domain);
using var user = UserPrincipal.FindByIdentity(domain, Environment.UserName);
var groups = user?.GetGroups();
Console.WriteLine(string.Join($"{Environment.NewLine}", groups));

This will fail when referencing this version of AD libs

<ItemGroup>
	<PackageReference Include="System.DirectoryServices.AccountManagement" Version="9.0.0" />
</ItemGroup>

When referencing .net 8 it works fine

<ItemGroup>
	<PackageReference Include="System.DirectoryServices.AccountManagement" Version="8.0.0" />
</ItemGroup>

Expected behavior

Return of roles for user

Actual behavior

Exception
Invalid URI: The hostname could not be parsed.'

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Nov 18, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-directoryservices, @jay98014
See info in area-owners.md if you want to be subscribed.

@CyLuGh
Copy link

CyLuGh commented Nov 18, 2024

Getting the same exception here.

Work around explained here:
#109858

@ericstj
Copy link
Member

ericstj commented Nov 18, 2024

Duplicate of #109858

@ericstj ericstj marked this as a duplicate of #109858 Nov 18, 2024
@ericstj ericstj closed this as completed Nov 18, 2024
@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants