Advertisement

03.31.2008 at 12:45PM PDT, ID: 23283724
[x]
Attachment Details

System.DirectoryServices.DirectorySearcher - search.FindOne causes app to crash on Vista

Asked by L00M in Microsoft Visual Basic.Net, .NET, Windows Vista

When running my app on XP, it's working great. However, when I attempt to run it on Vista (Business Edition), it simply crashes showing the following error:

"Appname has stopped working"

And that's it. Nothing more. I'm back to the prehistoric method of debugging by including MsgBoxs all over the code to see what is failing, and I've traced it to this line:

Dim result As SearchResult = search.FindOne()

AND, that code exists within a try/catch block. Vista is logged on to the network, and the object 'search' has been properly defined. Any ideas would be greatly appreciated.
TIA,
L00MStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
Try
                MsgBox("xLoginName = " & xLoginName)
                xUserName = ExtractUserName(xLoginName)
                MsgBox("xUserName=" & xUserName)
                xDomainName = ExtractDomainName(xLoginName)
                MsgBox("xDomainName=" & xDomainName)
                Dim entryRoot As New DirectoryEntry("LDAP://" & xDomainName)
                MsgBox("1.4")
                Dim search As New DirectorySearcher(entryRoot)
                MsgBox("1.5")
                search.Filter = [String].Format("(SAMAccountName={0})", xUserName)
                MsgBox("1.6")
                search.PropertiesToLoad.Add("cn")
                MsgBox("1.7")
                search.PropertiesToLoad.Add("sn")
                MsgBox("1.8")
                search.PropertiesToLoad.Add("DisplayName")
                MsgBox("1.9")
                search.PropertiesToLoad.Add("dn")
                MsgBox("1.10")
                search.PropertiesToLoad.Add("sAMAccountName")
                MsgBox("1.11")
                search.PropertiesToLoad.Add("givenname")
                MsgBox("1.12")
                search.PropertiesToLoad.Add("ou")
                MsgBox("1.13")
 
                Try
                    Dim result As SearchResult = search.FindOne()
                    MsgBox("1.14")
 
'All MsgBoxs work as expected, except 1.14. I never see it. :(
[+][-]03.31.2008 at 08:17PM PDT, ID: 21250984

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 05:58AM PDT, ID: 21253387

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 05:59AM PDT, ID: 21253390

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 07:48AM PDT, ID: 21254460

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 08:01AM PDT, ID: 21254616

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 10:05AM PDT, ID: 21255951

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 10:45AM PDT, ID: 21256314

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.01.2008 at 05:28PM PDT, ID: 21259241

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.03.2008 at 08:12AM PDT, ID: 21273492

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.03.2008 at 10:49AM PDT, ID: 21275031

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.03.2008 at 11:35AM PDT, ID: 21275512

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.03.2008 at 11:42AM PDT, ID: 21275588

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.03.2008 at 01:20PM PDT, ID: 21276547

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.03.2008 at 03:30PM PDT, ID: 21277581

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.04.2008 at 05:24AM PDT, ID: 21280862

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 12:20PM PDT, ID: 21405039

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.27.2008 at 07:00PM PDT, ID: 21657196

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]06.01.2008 at 06:39AM PDT, ID: 21687064

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, .NET, Windows Vista
Sign Up Now!
Solution Provided By: Computer101
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628