473,574 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DirectoryServic es Problem

Hi All....

I'm having a HECK of a time connecting to Active Directory using VB in
Visual Studio.NET 2003. Can anyone PLEASE help me?

All I am trying to do is list the current members of our Active Directory on
a web page. If I can connect to the AD interfaces, then I think I can
handle it from there.

I do have a VS.NET C# project successfully working and enumerating names,
but can NOT for the life of me get VB to work with AD.

I originally tried to do it outside of VS.NET, but ran into problems trying
to reference the System.Director yServices namespace unless I compiled the
project inside VS.NET. I did make an earlier post to this group about this
issue, and though the recommendations I received were insightful, they did
not work (neither precompiling, nor including a direct reference to the .dll
in the Page directive worked). I was finally able to import the name space
by copying the dll to the application's /bin directory. But why would I
want to make a copy of it when it already exists on the system? So what
happened to being able to build .NET applications with just a text editor???

So I decided to try a walkthrough of MS Knowledge Base article # 326340
(http://support.microsoft.com/default...0&Product=aspn
et). I followed it to the letter, and when I try to build the project in
VS.NET, I get compilation errors in the .vb file I cut and pasted directly
from the article!!!! The three errors are all in the LdapAuthenticat ion.vb
file:

E:\inetpub\Auth Test\LdapAuthen tication.vb(19) : Array bounds cannot appear in
type specifiers.
E:\inetpub\Auth Test\LdapAuthen tication.vb(23) : Name 'entry' is not declared.
E:\inetpub\Auth Test\LdapAuthen tication.vb(24) : Name 'entry' is not declared.

So.... if anyone can PLEASE HELP me get going here (I'm almost hoping one of
you can confirm my install is pooched, otherwise I have no idea why it does
not like the instructions as entered according to MS)

Again, all I need to do is connect to AD from a Web Page and list all the
users (Intranet site only).

Thanks in advance!

Keith C. Jakobs, MCP
Nov 21 '05 #1
5 2055
I guess a little more details on the errors would be useful....
E:\inetpub\Auth Test\LdapAuthen tication.vb(19) : Array bounds cannot appear in
type specifiers. (refers to '_path' in):
Dim entry As DirectoryEntry( _path, domainAndUserna me, pwd)
E:\inetpub\Auth Test\LdapAuthen tication.vb(23) : Name 'entry' is not declared. refers to:
Dim obj As Object = entry.NativeObj ect

and E:\inetpub\Auth Test\LdapAuthen tication.vb(24) : Name 'entry' is not

declared. refers to:
Dim search As DirectorySearch er = New DirectorySearch er(entry)

Which completely confuses me because 'entry' is deinfed in the first error
line, and a statement taken from MS instructions!!! !

..NET is soooo damn confusing. Please Help!
Thanks again!

Keith C. Jakobs, MCP

Nov 21 '05 #2
I do not have System.Director yServices.dll copied to my bin folder (copy
local=false), but I do have it referenced in VS.

Here is the AD code I am using in a web app, with no problems. Might want to
try this little function out and see if you can get it to work. Make sure
your virtual directory has anonymous access turned off.

Greg

Imports System.Director yServices
Public Class MyFunctions
Public Shared Function GetFullName(ByV al UserName As String) As String
Const DomainName As String = "mydomain.c om"

Dim oDirectory As New DirectoryEntry( "LDAP://" & DomainName)
Dim mySearcher As New DirectorySearch er(oDirectory)
Dim oResult As SearchResult
Dim sResult As String
mySearcher.Sear chScope = SearchScope.Sub tree
mySearcher.Refe rralChasing = ReferralChasing Option.All
mySearcher.Filt er = "(&(objectClass =user)(sAMAccou ntName=" &
UserName & "))"

Try
oResult = mySearcher.Find One
If Not oResult Is Nothing Then
sResult =
oResult.GetDire ctoryEntry.Prop erties("Display Name").Value.To String()
End If
Catch ex As Exception
Throw ex
End Try

oResult = Nothing
mySearcher.Disp ose()
oDirectory.Disp ose()

Return sResult
End Function
End Class

"Keith Jakobs, MCP" <el****@NOSPAM. hotmail.com> wrote in message
news:uC******** *******@TK2MSFT NGP12.phx.gbl.. .
Hi All....

I'm having a HECK of a time connecting to Active Directory using VB in
Visual Studio.NET 2003. Can anyone PLEASE help me?

All I am trying to do is list the current members of our Active Directory on a web page. If I can connect to the AD interfaces, then I think I can
handle it from there.

I do have a VS.NET C# project successfully working and enumerating names,
but can NOT for the life of me get VB to work with AD.

I originally tried to do it outside of VS.NET, but ran into problems trying to reference the System.Director yServices namespace unless I compiled the
project inside VS.NET. I did make an earlier post to this group about this issue, and though the recommendations I received were insightful, they did
not work (neither precompiling, nor including a direct reference to the ..dll in the Page directive worked). I was finally able to import the name space by copying the dll to the application's /bin directory. But why would I
want to make a copy of it when it already exists on the system? So what
happened to being able to build .NET applications with just a text editor???
So I decided to try a walkthrough of MS Knowledge Base article # 326340
(http://support.microsoft.com/default...0&Product=aspn et). I followed it to the letter, and when I try to build the project in
VS.NET, I get compilation errors in the .vb file I cut and pasted directly
from the article!!!! The three errors are all in the LdapAuthenticat ion.vb file:

E:\inetpub\Auth Test\LdapAuthen tication.vb(19) : Array bounds cannot appear in type specifiers.
E:\inetpub\Auth Test\LdapAuthen tication.vb(23) : Name 'entry' is not declared. E:\inetpub\Auth Test\LdapAuthen tication.vb(24) : Name 'entry' is not declared.
So.... if anyone can PLEASE HELP me get going here (I'm almost hoping one of you can confirm my install is pooched, otherwise I have no idea why it does not like the instructions as entered according to MS)

Again, all I need to do is connect to AD from a Web Page and list all the
users (Intranet site only).

Thanks in advance!

Keith C. Jakobs, MCP

Nov 21 '05 #3
Hi Greg,

Thanks so much for your response and sample code. Though I do appreciate
it, the .NET architecture has me completely confused. I have been
programming since I wrote Machine Language for 8088 and Z80 CPU's, and have
been published in Pascal.... but there are so many layers to .NET, I have no
idea how everything interfaces....

Though your sample code is not completely alien to me... I have no idea ....

(a) how to call it from a web page! How do I attach it to a form, or tell a
form to inherit the function (whichever is the correct terminology)??? ? I
could guess and play around, but right now, I'm just trying to get one
feature working, and will have no idea which part is not correct (the AD
code, or the connection to it???). I dont even know if I my files are
interconnected correctly at this point. Can I add it to an existing vb
file? Can I tell it to just compile the one form and associated code, so I
can ignore any other errors introduced by modifying global.asax or
web.config, or do I have to create a whole new project just to test this
little snippet. And then how do I connect the code to a form if I dont have
a namespace for it???

(b) what do I pass to it? I see the ByVal UserName parameter, and
understand ByVal parameter references... but where am I getting a UserName
to pass to it, or do I even need it?

BTW, since switching over to trying to make this work just in VS.NET, I have
included the reference to System.Director yServices. It no longer complains
about being able to import the namespace, but it still seems to have no idea
about what a DirectoryEntry is!

It's all so very confusing. I'm sorry, but I need a lot more direction on
how to test this code, and though I dont expect you to spend time doing so,
I am hoping someone out there knows a great reference or link that can help
solve my confusion regarding VS.NET project management and specific file
integration.

I do appreciate your help, but wish I knew what I am missing that makes .NET
seem so bewildering to me. I am not a newbie, I have been coding for a
fifth of a century and it is very frustrating that I am having so much of a
problem understanding how all these files work together in the .NET
architecture. And for that matter why I can not connect to the Directory
Services using VB!

I think I liked ADSI and ASP much better.... this is ridiculous! I never
had a problem interfacing with ADSI even using VBA, and have programmed some
very complicated routines using that model!

If anyone can point me to some decent comprehensive and TUTORIAL
documentation on how to use System.Director yServices in VB, it would be
greatly appreciated. Any books anyone would recommend??? Thanks!!!

Keith C. Jakobs, MCP

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:u6******** ******@TK2MSFTN GP10.phx.gbl...
I do not have System.Director yServices.dll copied to my bin folder (copy
local=false), but I do have it referenced in VS.

Here is the AD code I am using in a web app, with no problems. Might want to try this little function out and see if you can get it to work. Make sure
your virtual directory has anonymous access turned off.

Greg

Imports System.Director yServices
Public Class MyFunctions
Public Shared Function GetFullName(ByV al UserName As String) As String
Const DomainName As String = "mydomain.c om"

Dim oDirectory As New DirectoryEntry( "LDAP://" & DomainName)
Dim mySearcher As New DirectorySearch er(oDirectory)
Dim oResult As SearchResult
Dim sResult As String
mySearcher.Sear chScope = SearchScope.Sub tree
mySearcher.Refe rralChasing = ReferralChasing Option.All
mySearcher.Filt er = "(&(objectClass =user)(sAMAccou ntName=" &
UserName & "))"

Try
oResult = mySearcher.Find One
If Not oResult Is Nothing Then
sResult =
oResult.GetDire ctoryEntry.Prop erties("Display Name").Value.To String()
End If
Catch ex As Exception
Throw ex
End Try

oResult = Nothing
mySearcher.Disp ose()
oDirectory.Disp ose()

Return sResult
End Function
End Class

"Keith Jakobs, MCP" <el****@NOSPAM. hotmail.com> wrote in message
news:uC******** *******@TK2MSFT NGP12.phx.gbl.. .
Hi All....

I'm having a HECK of a time connecting to Active Directory using VB in
Visual Studio.NET 2003. Can anyone PLEASE help me?

All I am trying to do is list the current members of our Active Directory
on
a web page. If I can connect to the AD interfaces, then I think I can
handle it from there.

I do have a VS.NET C# project successfully working and enumerating
names, but can NOT for the life of me get VB to work with AD.

I originally tried to do it outside of VS.NET, but ran into problems

trying
to reference the System.Director yServices namespace unless I compiled the project inside VS.NET. I did make an earlier post to this group about

this
issue, and though the recommendations I received were insightful, they did not work (neither precompiling, nor including a direct reference to the

.dll
in the Page directive worked). I was finally able to import the name

space
by copying the dll to the application's /bin directory. But why would I
want to make a copy of it when it already exists on the system? So what
happened to being able to build .NET applications with just a text

editor???

So I decided to try a walkthrough of MS Knowledge Base article # 326340

(http://support.microsoft.com/default...0&Product=aspn
et). I followed it to the letter, and when I try to build the project in VS.NET, I get compilation errors in the .vb file I cut and pasted directly from the article!!!! The three errors are all in the

LdapAuthenticat ion.vb
file:

E:\inetpub\Auth Test\LdapAuthen tication.vb(19) : Array bounds cannot appear in
type specifiers.
E:\inetpub\Auth Test\LdapAuthen tication.vb(23) : Name 'entry' is not declared.
E:\inetpub\Auth Test\LdapAuthen tication.vb(24) : Name 'entry' is not

declared.

So.... if anyone can PLEASE HELP me get going here (I'm almost hoping

one of
you can confirm my install is pooched, otherwise I have no idea why it

does
not like the instructions as entered according to MS)

Again, all I need to do is connect to AD from a Web Page and list all

the users (Intranet site only).

Thanks in advance!

Keith C. Jakobs, MCP


Nov 21 '05 #4
You sound like me back when beta 2 was released. :^)

If you code doesn't know what DirectoryEntry is, even after referencing
System.Director yServices then you probably have not added the imports
statement at the top of your class file:

Imports System.Director yServices

This is just a shortcut, so you don't have to type
System.Director yServices.Direc toryEntry

As far as using my code. I would suggest making a new project to play. (I
took a look at that link to MS example, and they were doing some heady
things with your default web.config and stuff that will just confuse the
issue at hand).

Just add a new class file to your project. Right-click your project root,
choose Add New Item, select Class file. Name it MyFunctions.vb. Now just
past in my code.

Then from within your Page_Load method of, say your default.aspx page, do
this:

response.write( MyFunctions.Get FullName("mydom ain\burnsg"))

where the username is a valid username on your domain.

Just to be clear, this function doesn't do what you are trying to do. It
just takes a username and looks up the displayname from AD. It is just a
test to see that your can talk to AD.
(a) how to call it from a web page! How do I attach it to a form, or tell a form to inherit the function (whichever is the correct terminology)??? ? I
I would use the term "calling a method on a shared class". Another approach
(more complicated by far) would to have the MyFuctions class inherit from
Page. And have all of your .aspx pages inherit from MyFuctions rather than
the Page class. That way you could just call GetFullName directly from
Page_Load without the qualifier. But that is overkill for this exmample.

Let me know if I can help some more.

Greg

"Keith Jakobs, MCP" <el****@NOSPAM. hotmail.com> wrote in message
news:u%******** ********@TK2MSF TNGP11.phx.gbl. .. Hi Greg,

Thanks so much for your response and sample code. Though I do appreciate
it, the .NET architecture has me completely confused. I have been
programming since I wrote Machine Language for 8088 and Z80 CPU's, and have been published in Pascal.... but there are so many layers to .NET, I have no idea how everything interfaces....

Though your sample code is not completely alien to me... I have no idea .....
(a) how to call it from a web page! How do I attach it to a form, or tell a form to inherit the function (whichever is the correct terminology)??? ? I
could guess and play around, but right now, I'm just trying to get one
feature working, and will have no idea which part is not correct (the AD
code, or the connection to it???). I dont even know if I my files are
interconnected correctly at this point. Can I add it to an existing vb
file? Can I tell it to just compile the one form and associated code, so I can ignore any other errors introduced by modifying global.asax or
web.config, or do I have to create a whole new project just to test this
little snippet. And then how do I connect the code to a form if I dont have a namespace for it???

(b) what do I pass to it? I see the ByVal UserName parameter, and
understand ByVal parameter references... but where am I getting a UserName
to pass to it, or do I even need it?

BTW, since switching over to trying to make this work just in VS.NET, I have included the reference to System.Director yServices. It no longer complains about being able to import the namespace, but it still seems to have no idea about what a DirectoryEntry is!

It's all so very confusing. I'm sorry, but I need a lot more direction on
how to test this code, and though I dont expect you to spend time doing so, I am hoping someone out there knows a great reference or link that can help solve my confusion regarding VS.NET project management and specific file
integration.

I do appreciate your help, but wish I knew what I am missing that makes ..NET seem so bewildering to me. I am not a newbie, I have been coding for a
fifth of a century and it is very frustrating that I am having so much of a problem understanding how all these files work together in the .NET
architecture. And for that matter why I can not connect to the Directory
Services using VB!

I think I liked ADSI and ASP much better.... this is ridiculous! I never
had a problem interfacing with ADSI even using VBA, and have programmed some very complicated routines using that model!

If anyone can point me to some decent comprehensive and TUTORIAL
documentation on how to use System.Director yServices in VB, it would be
greatly appreciated. Any books anyone would recommend??? Thanks!!!

Keith C. Jakobs, MCP

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:u6******** ******@TK2MSFTN GP10.phx.gbl...
I do not have System.Director yServices.dll copied to my bin folder (copy
local=false), but I do have it referenced in VS.

Here is the AD code I am using in a web app, with no problems. Might want
to
try this little function out and see if you can get it to work. Make sure your virtual directory has anonymous access turned off.

Greg

Imports System.Director yServices
Public Class MyFunctions
Public Shared Function GetFullName(ByV al UserName As String) As String Const DomainName As String = "mydomain.c om"

Dim oDirectory As New DirectoryEntry( "LDAP://" & DomainName)
Dim mySearcher As New DirectorySearch er(oDirectory)
Dim oResult As SearchResult
Dim sResult As String
mySearcher.Sear chScope = SearchScope.Sub tree
mySearcher.Refe rralChasing = ReferralChasing Option.All
mySearcher.Filt er = "(&(objectClass =user)(sAMAccou ntName=" &
UserName & "))"

Try
oResult = mySearcher.Find One
If Not oResult Is Nothing Then
sResult =
oResult.GetDire ctoryEntry.Prop erties("Display Name").Value.To String()
End If
Catch ex As Exception
Throw ex
End Try

oResult = Nothing
mySearcher.Disp ose()
oDirectory.Disp ose()

Return sResult
End Function
End Class

"Keith Jakobs, MCP" <el****@NOSPAM. hotmail.com> wrote in message
news:uC******** *******@TK2MSFT NGP12.phx.gbl.. .
Hi All....

I'm having a HECK of a time connecting to Active Directory using VB in
Visual Studio.NET 2003. Can anyone PLEASE help me?

All I am trying to do is list the current members of our Active Directory
on
a web page. If I can connect to the AD interfaces, then I think I can
handle it from there.

I do have a VS.NET C# project successfully working and enumerating

names, but can NOT for the life of me get VB to work with AD.

I originally tried to do it outside of VS.NET, but ran into problems

trying
to reference the System.Director yServices namespace unless I compiled the project inside VS.NET. I did make an earlier post to this group about

this
issue, and though the recommendations I received were insightful, they did not work (neither precompiling, nor including a direct reference to the .dll
in the Page directive worked). I was finally able to import the name

space
by copying the dll to the application's /bin directory. But why would
I want to make a copy of it when it already exists on the system? So what happened to being able to build .NET applications with just a text

editor???

So I decided to try a walkthrough of MS Knowledge Base article # 326340

(http://support.microsoft.com/default...0&Product=aspn
et). I followed it to the letter, and when I try to build the project in VS.NET, I get compilation errors in the .vb file I cut and pasted directly from the article!!!! The three errors are all in the

LdapAuthenticat ion.vb
file:

E:\inetpub\Auth Test\LdapAuthen tication.vb(19) : Array bounds cannot appear
in
type specifiers.
E:\inetpub\Auth Test\LdapAuthen tication.vb(23) : Name 'entry' is not

declared.
E:\inetpub\Auth Test\LdapAuthen tication.vb(24) : Name 'entry' is not

declared.

So.... if anyone can PLEASE HELP me get going here (I'm almost hoping

one
of
you can confirm my install is pooched, otherwise I have no idea why it

does
not like the instructions as entered according to MS)

Again, all I need to do is connect to AD from a Web Page and list all

the users (Intranet site only).

Thanks in advance!

Keith C. Jakobs, MCP



Nov 21 '05 #5
Hi Greg!

Thanks so much for taking the additional time to clarify some of those
issues and provide more detailed instructions.

I will give those a try and see how successful I am. FYI though, I do have
the 'Imports System.Director yServices' in my class file, but it wasnt until
I compiled it within VS.NET that the IIS server knew what to do with it!

Keith

Keith C. Jakobs, MCP

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:uc******** ******@TK2MSFTN GP09.phx.gbl...
You sound like me back when beta 2 was released. :^)

If you code doesn't know what DirectoryEntry is, even after referencing
System.Director yServices then you probably have not added the imports
statement at the top of your class file:

Imports System.Director yServices

This is just a shortcut, so you don't have to type
System.Director yServices.Direc toryEntry

As far as using my code. I would suggest making a new project to play. (I took a look at that link to MS example, and they were doing some heady
things with your default web.config and stuff that will just confuse the
issue at hand).

Just add a new class file to your project. Right-click your project root,
choose Add New Item, select Class file. Name it MyFunctions.vb. Now just
past in my code.

Then from within your Page_Load method of, say your default.aspx page, do
this:

response.write( MyFunctions.Get FullName("mydom ain\burnsg"))

where the username is a valid username on your domain.

Just to be clear, this function doesn't do what you are trying to do. It
just takes a username and looks up the displayname from AD. It is just a
test to see that your can talk to AD.
(a) how to call it from a web page! How do I attach it to a form, or tell
a
form to inherit the function (whichever is the correct terminology)??? ? I

I would use the term "calling a method on a shared class". Another approach (more complicated by far) would to have the MyFuctions class inherit from
Page. And have all of your .aspx pages inherit from MyFuctions rather than
the Page class. That way you could just call GetFullName directly from
Page_Load without the qualifier. But that is overkill for this exmample.

Let me know if I can help some more.

Greg

"Keith Jakobs, MCP" <el****@NOSPAM. hotmail.com> wrote in message
news:u%******** ********@TK2MSF TNGP11.phx.gbl. ..
Hi Greg,

Thanks so much for your response and sample code. Though I do
appreciate it, the .NET architecture has me completely confused. I have been
programming since I wrote Machine Language for 8088 and Z80 CPU's, and

have
been published in Pascal.... but there are so many layers to .NET, I have no
idea how everything interfaces....

Though your sample code is not completely alien to me... I have no idea ....

(a) how to call it from a web page! How do I attach it to a form, or

tell a
form to inherit the function (whichever is the correct terminology)??? ?
I could guess and play around, but right now, I'm just trying to get one
feature working, and will have no idea which part is not correct (the AD
code, or the connection to it???). I dont even know if I my files are
interconnected correctly at this point. Can I add it to an existing vb
file? Can I tell it to just compile the one form and associated code, so I
can ignore any other errors introduced by modifying global.asax or
web.config, or do I have to create a whole new project just to test this
little snippet. And then how do I connect the code to a form if I dont have
a namespace for it???

(b) what do I pass to it? I see the ByVal UserName parameter, and
understand ByVal parameter references... but where am I getting a

UserName to pass to it, or do I even need it?

BTW, since switching over to trying to make this work just in VS.NET, I

have
included the reference to System.Director yServices. It no longer

complains
about being able to import the namespace, but it still seems to have no

idea
about what a DirectoryEntry is!

It's all so very confusing. I'm sorry, but I need a lot more direction on how to test this code, and though I dont expect you to spend time doing

so,
I am hoping someone out there knows a great reference or link that can

help
solve my confusion regarding VS.NET project management and specific file
integration.

I do appreciate your help, but wish I knew what I am missing that makes

.NET
seem so bewildering to me. I am not a newbie, I have been coding for a
fifth of a century and it is very frustrating that I am having so much of a
problem understanding how all these files work together in the .NET
architecture. And for that matter why I can not connect to the
Directory Services using VB!

I think I liked ADSI and ASP much better.... this is ridiculous! I never had a problem interfacing with ADSI even using VBA, and have programmed

some
very complicated routines using that model!

If anyone can point me to some decent comprehensive and TUTORIAL
documentation on how to use System.Director yServices in VB, it would be
greatly appreciated. Any books anyone would recommend??? Thanks!!!

Keith C. Jakobs, MCP

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:u6******** ******@TK2MSFTN GP10.phx.gbl...
I do not have System.Director yServices.dll copied to my bin folder (copy local=false), but I do have it referenced in VS.

Here is the AD code I am using in a web app, with no problems. Might want
to
try this little function out and see if you can get it to work. Make

sure your virtual directory has anonymous access turned off.

Greg

Imports System.Director yServices
Public Class MyFunctions
Public Shared Function GetFullName(ByV al UserName As String) As String Const DomainName As String = "mydomain.c om"

Dim oDirectory As New DirectoryEntry( "LDAP://" & DomainName)
Dim mySearcher As New DirectorySearch er(oDirectory)
Dim oResult As SearchResult
Dim sResult As String
mySearcher.Sear chScope = SearchScope.Sub tree
mySearcher.Refe rralChasing = ReferralChasing Option.All
mySearcher.Filt er = "(&(objectClass =user)(sAMAccou ntName=" &
UserName & "))"

Try
oResult = mySearcher.Find One
If Not oResult Is Nothing Then
sResult =
oResult.GetDire ctoryEntry.Prop erties("Display Name").Value.To String()
End If
Catch ex As Exception
Throw ex
End Try

oResult = Nothing
mySearcher.Disp ose()
oDirectory.Disp ose()

Return sResult
End Function
End Class

"Keith Jakobs, MCP" <el****@NOSPAM. hotmail.com> wrote in message
news:uC******** *******@TK2MSFT NGP12.phx.gbl.. .
> Hi All....
>
> I'm having a HECK of a time connecting to Active Directory using VB in > Visual Studio.NET 2003. Can anyone PLEASE help me?
>
> All I am trying to do is list the current members of our Active

Directory
on
> a web page. If I can connect to the AD interfaces, then I think I can > handle it from there.
>
> I do have a VS.NET C# project successfully working and enumerating

names,
> but can NOT for the life of me get VB to work with AD.
>
> I originally tried to do it outside of VS.NET, but ran into problems
trying
> to reference the System.Director yServices namespace unless I compiled the
> project inside VS.NET. I did make an earlier post to this group
about this
> issue, and though the recommendations I received were insightful, they
did
> not work (neither precompiling, nor including a direct reference to the .dll
> in the Page directive worked). I was finally able to import the
name space
> by copying the dll to the application's /bin directory. But why would I > want to make a copy of it when it already exists on the system? So what > happened to being able to build .NET applications with just a text
editor???
>
> So I decided to try a walkthrough of MS Knowledge Base article # 326340 >

(http://support.microsoft.com/default...0&Product=aspn > et). I followed it to the letter, and when I try to build the project in
> VS.NET, I get compilation errors in the .vb file I cut and pasted

directly
> from the article!!!! The three errors are all in the
LdapAuthenticat ion.vb
> file:
>
> E:\inetpub\Auth Test\LdapAuthen tication.vb(19) : Array bounds cannot

appear
in
> type specifiers.
> E:\inetpub\Auth Test\LdapAuthen tication.vb(23) : Name 'entry' is not
declared.
> E:\inetpub\Auth Test\LdapAuthen tication.vb(24) : Name 'entry' is not
declared.
>
> So.... if anyone can PLEASE HELP me get going here (I'm almost
hoping one
of
> you can confirm my install is pooched, otherwise I have no idea why
it does
> not like the instructions as entered according to MS)
>
> Again, all I need to do is connect to AD from a Web Page and list

all the
> users (Intranet site only).
>
> Thanks in advance!
>
> Keith C. Jakobs, MCP
>
>



Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
9598
by: hykim | last post by:
Hello, everyone. according to MSDN, there is any constructor of System.DirectoryServices.SearchResultCollection Class. if I implement DirectorySearcher.FindAll() method by myself, then how can I instanciate SearchResultCollection Class. more clearly, a SearchResult object is created, at the inside of FindAll() method, then how can I put...
1
7371
by: Jason Gleason | last post by:
I am using the following method in a web service that utilizes the system.directoryservices namespace: public ArrayList GetAllAppPools(){ System.DirectoryServices.DirectoryEntry apppools = new DirectoryEntry("IIS://webserver/W3SVC/AppPools"); ArrayList appPoolNames = new ArrayList(); foreach(DirectoryEntry de in apppools.Children) {...
1
16165
by: Gaab | last post by:
Hi Folks, After the weekend I wanted to start working on my c#/asp.net project, but when I tried to open it on my machine i got the following error: Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your...
1
1712
by: Enosh Chang | last post by:
Hi all, I encounter some problem in DirectoryServices, could someone help me? private void InitLoginUser() { DirectoryEntry objEntry = new DirectoryEntry(); DirectorySearcher objSearcher = new DirectorySearcher(); SearchResult objResult;
9
2135
by: Günther Rühmann | last post by:
Hi, I´m not sure if i´m right int this group... My problem: I made a vb .net application that reads from AD via System.Directoryservices.Directoryentry. The appliocation enumerates group members. It works fine on W2k - machines. It works on a WinNT 4 - server, too, but it stops with a runtime error on any Windows 4.0 Workstation. The error...
7
2922
by: turbon | last post by:
Hello, I am writing code, which will copy webServices from one IIS 6.0 webserver to another and using DirentoryServices to achieve this purpose. And I have problems with authentication - I get an error whenever I try to read properties of DirectoryEntry object. I had same problems when I was using WMI, but there setting ConnectionOptions co...
6
4070
by: Mark Rae | last post by:
Hi, I'm in the process of updating an ASP.NET v1.1 web app to v2. The app uses ActiveDirectory a great deal, and I'm trying to use the new System.Collections.Generic namespace where possible, having been advised by several luminaries that that is a "good thing to do"... :-) However, I'm experiencing a problem with the IEnumerable...
6
5457
by: bugnthecode | last post by:
Hi, I'm building a small desktop app in VS Std 2005 with C# and .net 2.0. I've managed to get the code together to query the ldap my company has, but every time I attempt to access a specific property a COM Exception gets thrown, and I can't figure out why. This is a desktop app. example("ldap.example.com", "ou=People,dc=example,dc=com"); ...
7
2812
by: aamirghanchi | last post by:
Hi, I had .Net 1.1 app that worked fine. I recently migrated it to 2.0 but am getting compilation errors, among which DirectoryServices classes are not being recognized by the VS 2005 at build time. I can clearly see the reference to System.DirectoryServices 2.0.0 GAC in the reference list and there is no error where the Imports...
0
7828
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7840
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6493
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5329
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3765
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2257
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1092
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.