locked
System.DirectoryServices Not Available RRS feed

  • Question

  • User-1184513863 posted

    I'm using Visual Studio 2005, I have .Net 2.0 installed, and for some reason the System.DirectoryServices namespace isn't available and I get an error when I try to use it on an aspx page.  I'm new to querying AD, but not programming.  Everything I see about querying AD says to use this namespace.  Is there any other way to do so or any fix to why it's not working?  I'm trying to query AD to get a list of users that are in a certain domain group.  Any thoughts/ideas/suggestions?

    Monday, September 11, 2006 1:06 PM

Answers

  • User-2041805088 posted
    Have you tried adding a reference to System.DirectoryServices.dll to your project?
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 11, 2006 3:24 PM
  • User-2041805088 posted

    I just created a new project and it looks like it's not included by default. So, you need to add a reference to that assembly.
     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 11, 2006 3:30 PM

All replies

  • User-2041805088 posted
    Have you tried adding a reference to System.DirectoryServices.dll to your project?
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 11, 2006 3:24 PM
  • User-1184513863 posted
    That worked, thanks!  But I don't understand why that wouldn't be available in the first place.  Why do I need to create an explicit reference to it?
    Monday, September 11, 2006 3:27 PM
  • User-2041805088 posted

    I just created a new project and it looks like it's not included by default. So, you need to add a reference to that assembly.
     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 11, 2006 3:30 PM
  • User-1008239536 posted

    I am building a web application that needs to use System.DirectoryServices, but we do not yet have Visual Studio 2005 (waiting for order approval).  Currently I'm writing the page straight up in Notepad.  How would I go about including the appropriate references to this library?

    Through my searching some places say to add it to the Web.config file under the Assemblies tag.  I tried that but got the following error message:

    "Could not load file or assembly 'System.DirectoryServices' or one of its dependances.  The system cannot find the file specified." 

    The referencing tag in the web.config file I added looks like this: <add assembly="System.DirectoryServices" />. 

    The other tags look like this: <add assembly="System.Web.Mobile, Version=2.0.0.0, culture=neutral, PublicKeyToken=[some key string]" />

     I'm sorry if this is a confusing question, but I am hopelessly confused on this.  I'm learning things as I go, so I'm getting stuck on weird bits

    Tuesday, October 10, 2006 9:11 AM