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

  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.

I think you should install Directory Services Package.

Install-Package System.DirectoryServices -Version 4.0.0 

Directory Services Package


Shot in the dark: have you tried adding to the web.config:

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

Is the web-server (IIS or whatever) configured to run the folder as an application (i.e. shows as a cog), and is it using the correct version of ASP.NET? If it is running as 1.1, bits of it might work - but it would fail to find that 2.0 assembly in the 1.1 GAC.