If you have installed the Microsoft .NET Framework 1.1 Service Pack 1 (SP1) or the .NET Framework 1.0 Service Pack 3 (SP3), you may receive error messages or experience unexpected behavior when you use the
System.DirectoryServices namespace.
These errors may occur when you perform different types of operations on
PropertyValueCollection class can generate these errors.�For example, you may receive one of the following error messages:
Error message 1Operation is not valid due to the current state of the object.
Error message 2An unhandled exception of type System.InvalidOperationException' occurred in mscorlib.dll.
Error message 3 Error message 3 occurs when the credentials in a DirectoryEntry are authenticated, typically on a RefreshCache operation. For example:
DirectoryEntry de = new DirectoryEntry(sLDAP, sUsername, sPassword, AuthenticationTypes.Secure);de.RefreshCache();
Error message 4You may recieve error message 4 during a bind operation. Notice that the bind connection will not occur until an operation is performed. If a
RefreshCache method operation is not performed, the failure may occur later in the code. For example, the failure may occur during a
FindAll method operation.
DirectoryEntry de = new DirectoryEntry(strLDAP);
// Bind not performed yet
DirectorySearcher mySearcher = new DirectorySearcher(de);
//the bind has not occured yet - but will happen when the next line executes
// this line could generate the error Not Implemented
SearchResultCollection result = mySearcher.FindAll();