Thursday, June 9, 2011

ASP.NET 4.0 System.DirectoryServices.DLL

Hi

While trying to use Active Directory from within a web service to authenticate users, I simply could not get the statement

Imports System.DirectoryServices

to work from within my ASMX file.

I would add the reference to the DLL to the project but the Imports statement simply would not work.

I, then, copied the System.DirectoryServices.dll from this path

c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\

on my laptop - it may be different on your system

and put it into the BIN folder of my project.

And presto, the  Imports statement works!

Wonder why this happens

Let me know if you find an answer

Cheers