Type not defined error

Discussion in 'ASP .Net' started by J Quick, Jul 22, 2004.

  1. J Quick

    J Quick Guest

    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?
     
    J Quick, Jul 22, 2004
    #1
    1. Advertising

  2. 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.

    "J Quick" <> wrote in message news:<>...
    > 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?
     
    Kjetil Nordahl, Jul 23, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nuve
    Replies:
    0
    Views:
    1,990
  2. Kabeer
    Replies:
    6
    Views:
    3,230
    Thomas Matthews
    Aug 21, 2003
  3. Oodini
    Replies:
    1
    Views:
    1,779
    Keith Thompson
    Sep 27, 2005
  4. uche
    Replies:
    4
    Views:
    911
    Lionel B
    Feb 18, 2007
  5. Replies:
    1
    Views:
    506
    Sion Arrowsmith
    Jul 10, 2008
Loading...

Share This Page