Using System.DirectoryServices from within webservice

Discussion in 'ASP .Net Web Services' started by BT Ong, Sep 1, 2003.

  1. BT Ong

    BT Ong Guest

    I am trying to access to my AD using LDAP in a ASP.NET web service.
    I use System.DirectoryServices.DirectoryEntry.

    However, when I try to open the asmx file in a browser, the following
    compile error appears:
    CS0234L: The type or namespace 'DirectoryServices' does not exist in the
    class or namespace 'System' (are you missing a reference")

    Does that mean I can't access the AD from within a web service?
     
    BT Ong, Sep 1, 2003
    #1
    1. Advertising

  2. BT Ong

    DAve Guest

    I've run into the same problem and can't seem to find any information
    as to why this error is being thrown. Anyone have an answer?

    I get a compile error when inserting the line
    using System.DirectoryServices;

    in a c# .asmx file.

    Thanks,
     
    DAve, Jan 12, 2005
    #2
    1. Advertising

  3. Hello Dave,
    Try adding a reference to it in the project

    HTH
    Regards,
    Dilip Krishnan
    MCAD, MCSD.net
    dkrishnan at geniant dot com
    http://www.geniant.com

    > I've run into the same problem and can't seem to find any information
    > as to why this error is being thrown. Anyone have an answer?
    >
    > I get a compile error when inserting the line
    > using System.DirectoryServices;
    > in a c# .asmx file.
    >
    > Thanks,
    >
     
    Dilip Krishnan, Jan 13, 2005
    #3
  4. BT Ong

    DAve Guest

    The problem is that I am creating the .asmx files outside of Visual
    Studio and letting .net compile it when it's accessed. What does
    Visual Studio add to the .asmx file that accomplishes the reference?
    Does Visual Studio compile it and provide a non-text file to use
    instead of an .asmx file?

    Thanks for the help,

    Dave
     
    DAve, Jan 13, 2005
    #4
  5. Hello Dave,
    Copy System.DirectoryServices to the bin directory

    HTH
    Regards,
    Dilip Krishnan
    MCAD, MCSD.net
    dkrishnan at geniant dot com
    http://www.geniant.com

    > The problem is that I am creating the .asmx files outside of Visual
    > Studio and letting .net compile it when it's accessed. What does
    > Visual Studio add to the .asmx file that accomplishes the reference?
    > Does Visual Studio compile it and provide a non-text file to use
    > instead of an .asmx file?
    >
    > Thanks for the help,
    >
    > Dave
    >
     
    Dilip Krishnan, Jan 13, 2005
    #5
  6. BT Ong

    DAve Guest

    Thanks very much - that did the trick.
     
    DAve, Jan 14, 2005
    #6
    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. Edward
    Replies:
    1
    Views:
    2,458
    Edward
    Jul 8, 2003
  2. David M. Weprin

    System.DirectoryServices

    David M. Weprin, Oct 17, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    394
    Yovi Oktofianus
    Oct 18, 2003
  3. Nam
    Replies:
    2
    Views:
    4,499
  4. Homer J. Simpson
    Replies:
    2
    Views:
    155
    Homer J. Simpson
    Nov 8, 2003
  5. Nam

    Error using System.DirectoryServices

    Nam, Jan 9, 2008, in forum: ASP .Net Security
    Replies:
    2
    Views:
    234
Loading...

Share This Page