My code will run in Windows (non-mono) and in Linux (mono). Currently, I am using System.DirectoryServices, which works great in Windows. But in Linux:
System.NullReferenceException: Object reference not set to an instance of an object
at System.DirectoryServices.DirectorySearcher.InitBlock () [0x00000]
at System.DirectoryServices.DirectorySearcher.DoSearch () [0x00000]
at System.DirectoryServices.DirectorySearcher.get_SrchColl () [0x00000]
at System.DirectoryServices.DirectorySearcher.FindOne () [0x00000]
at (wrapper remoting-invoke-with-check) System.DirectoryServices.DirectorySearcher:FindOne ()