i have figured out where the error happen, but i don't know why:
public string GetUserADProperties(string propertyName){
string propertyValue = "";
DirectoryEntry entry = GetDirectoryEntry();
DirectorySearcher search = GetDirectorySearcher(entry);
search.Filter = "(&(&(objectClass=user)(SamAccountName=" + GetCurrentUser() + ")))";
search.PropertiesToLoad.Add(propertyName);
SearchResult result = search.FindOne();
if(result != null){
HERE -->> propertyValue = result.Properties[propertyName][0].ToString();
}
return propertyValue;
}