Type not defined error

J

J Quick

I'm getting the following compilation error on the line of vb.net script in
the aspx code below.

Compiler Error Message: BC30002: Type 'DirectoryEntry' is not defined.

Dim dirEntry As new DirectoryEntry(strLDAPPath)


I have System.DirectoryServices added to the project references and to the
aspx form. The autogenerated code includes "Imports
System.DirectoryServices" in the source. I get the same error with the
fully qualified reference "...as new
System.DirectoryServices.DirectoryEntry(strLDAPPath)."

Any idea what's need to get the compiler to see the reference?
 
K

Kjetil Nordahl

I had no problems compiling the code.

This is what I did:
I created a new "ASP.NET Web Application" project.
I added a reference to "System.DirectoryServices.dll"
In the code for the default form I added "Imports
System.DirectoryServices" as the first line of code.
In Sub Page_Load I added this code:
Dim dirEntry As New DirectoryEntry("something")
Then I built the project, with no errors.

So the default settings for the project should be fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top