Professional Web Applications Themes

Using System.DirectoryServices from within webservice - ASP.NET Web Services

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

  1. #1

    Default Using System.DirectoryServices from within webservice

    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 Guest

  2. #2

    Default Re: Using System.DirectoryServices from within webservice

    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 Guest

  3. #3

    Default Re: Using System.DirectoryServices from within webservice

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

    HTH
    Regards,
    Dilip Krishnan
    MCAD, MCSD.net
    dkrishnan at geniant dot com
    [url]http://www.geniant.com[/url]
    > 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 Guest

  4. #4

    Default Re: Using System.DirectoryServices from within webservice

    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 Guest

  5. #5

    Default Re: Using System.DirectoryServices from within webservice

    Hello Dave,
    Copy System.DirectoryServices to the bin directory

    HTH
    Regards,
    Dilip Krishnan
    MCAD, MCSD.net
    dkrishnan at geniant dot com
    [url]http://www.geniant.com[/url]
    > 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 Guest

  6. #6

    Default Re: Using System.DirectoryServices from within webservice

    Thanks very much - that did the trick.

    DAve Guest

Similar Threads

  1. System.DirectoryServices - The server is not operational
    By George Durzi in forum ASP.NET Security
    Replies: 10
    Last Post: December 29th, 12:00 AM
  2. System.DirectoryServices
    By Brian in forum ASP.NET Security
    Replies: 3
    Last Post: June 9th, 08:29 PM
  3. System.Directoryservices getting TxIsolationLevel exeption?
    By Robert Wallström in forum ASP.NET Security
    Replies: 5
    Last Post: June 5th, 03:08 AM
  4. System.DirectoryServices missing reference
    By Markus Bauer in forum ASP.NET Web Services
    Replies: 0
    Last Post: October 22nd, 10:25 AM
  5. Imports 'System.DirectoryServices' cannot be found.
    By Edward in forum ASP.NET General
    Replies: 1
    Last Post: July 8th, 12:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139