Skip to content

FileNotFoundException caught while trying to Lookup the DisplayName with 'UserPrincipal.Current.DisplayName'

FlorianDecker edited this page Jan 22, 2016 · 2 revisions

This Exception gets thrown during the AD Lookup (which is needed to retrieve the DisplayName). See http://stackoverflow.com/questions/33717673/system-directoryservices-accountmanagement-principalcontext-broken-after-windows/34231046 for more details.

Summary: On Windows 10 it does not find the .dll which is needed for the AD Lookup.

Interestingly enough, you can fix it, by editing the registry. Start "regedit" from the Windows Start Menu and go to HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion where you add "RegisteredOwner" and "RegisteredOrganization" as String value. You may edit their value with your respective username and company name but it seems like you can leave them empty too.

When we can't find the DisplayName, the Property %DisplayName% gets replaced by "<Unknown>". So if you dont use the Property %DisplayName%, you can ignore this warning.