Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.DirectoryServices is not recognised in the namespace 'System'

I'm trying to use System.DirectoryServices in a web site project and I'm getting this error:

The type or namespace name 'DirectoryServices' does not exist in the namespace 'System' (are you missing an assembly reference?)

My project has a reference to System.DirectoryServices in web.config:

<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>   

And I do have using System.DirectoryServices in the files where I want to use it.

Does anybody have a clue where to look for the problem?

like image 583
jansokoly Avatar asked Nov 05 '08 13:11

jansokoly


People also ask

What is System DirectoryServices AccountManagement?

System. DirectoryServices. AccountManagement manages directory objects independent of the System.

What is DirectorySearcher in c# net?

Use a DirectorySearcher object to search and perform queries against an Active Directory Domain Services hierarchy using Lightweight Directory Access Protocol (LDAP). LDAP is the only system-supplied Active Directory Service Interfaces (ADSI) provider that supports directory searching.

What is C# DirectoryEntry?

The DirectoryEntry class presents a node or object in the Active Directory hierarchy. The Add method creates a request to create a new entry in the container. The Find method returns the child with the specified name. The Remove method deletes a child DirectoryEntry from this collection.


1 Answers

  1. Right click on References under your solution.
  2. Select Add Reference. The reference can be found under the Framework Assemblies list. Select System.DirectoryServices and click Add.
like image 131
user1947015 Avatar answered Sep 23 '22 05:09

user1947015