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

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

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:
    2,281
  2. Nuve Nai
    Replies:
    0
    Views:
    1,076
    Nuve Nai
    Oct 23, 2003
  3. Joey
    Replies:
    3
    Views:
    3,289
    =?Utf-8?B?UnlhbiBSaWRkZWxs?=
    Aug 6, 2004
  4. TJS
    Replies:
    2
    Views:
    743
  5. =?Utf-8?B?SmF5?=
    Replies:
    1
    Views:
    2,248
    Jim Andersen
    Jan 26, 2006
  6. Kabeer
    Replies:
    6
    Views:
    3,511
    Thomas Matthews
    Aug 21, 2003
  7. Oodini
    Replies:
    1
    Views:
    2,037
    Keith Thompson
    Sep 27, 2005
  8. uche
    Replies:
    4
    Views:
    1,153
    Lionel B
    Feb 18, 2007
Loading...