Can't import System.DirectoryServices.AccountManagement

Hi everyone,

I am using System.DirectoryServices.AccountManagement.UserPrincipal.Current.EmailAddress in my code, that’s why I need to import the namespace System.DirectoryServices.AccountManagement.

For two xamls the import is working, but wierdly not for the last one.

For the import I added
to their xamls.

I also tried to install the namespace as a package, but the installation always fails, whichever version.

My studio is version 2019.10.2

Any help is appreciated.


Welcome to UiPath community

Check this link, i have resolved the same issue for me

System.DirectoryServices.AccountManagement Package Installation Failure

What error you get? Maybe that 3rd xaml needs something else, maybe System.DirectoryServices…

One of the files that are not showing a validation error has the errormessage “Enter own mail address: The object of the type “System.DirectoryServices.AccountManagement.GroupPrincipal” cannot be converted into “System.DirectoryServices.AccountManagement.UserPrincipal”” (translated).

The one with the validation error says ““DirectoryServices” is not a member of “System”” (translated), even though System.DirectoryServices.AccountManagement is being imported.

Thanks, but this didn’t work for me.

Those are 2 different (and separated) namespaces, that you might need to import:

  • System.DirectoryServices
  • System.DirectoryServices.AccountManagement