Tulpep / Active-Directory-Object-Picker

The standard Active Directory object picker dialog for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

System.AccessViolationException

mkaec opened this issue · comments

commented

Sometimes calling DirectoryObjectPickerDialog.ShowDialog() will cause a System.AccessViolationException. Usually, this can be replicated by multiple calls in the same session. Use of the object is wrapped in a using statement. Today, I had the application in the VS debugger and it downloaded a source code file to show me where the exception occurred.

AccessViolationException

commented

I notice that my code is different from the example in that it uses AttributesToFetch.

directoryObjectPicker.AttributesToFetch.Add("displayName");
directoryObjectPicker.AttributesToFetch.Add("sAMAccountName");
directoryObjectPicker.AttributesToFetch.Add("objectSid");
directoryObjectPicker.AttributesToFetch.Add("objectGUID");
commented

I had changed the code to remove use of AttributesToFetch, but it seems the crash is still randomly occurring.