Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.AccessViolationException #40

Open
mkaec opened this issue Apr 16, 2021 · 2 comments
Open

System.AccessViolationException #40

mkaec opened this issue Apr 16, 2021 · 2 comments

Comments

@mkaec
Copy link

mkaec commented Apr 16, 2021

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

@mkaec
Copy link
Author

mkaec commented Apr 16, 2021

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");

@mkaec
Copy link
Author

mkaec commented May 28, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant