I\'m trying to use System.DirectoryServices
in a web site project and I\'m getting this error:
The type or namespace name \'DirectoryServices
I had the same problem when I tried to convert website to web-app.
It looks like vs failing to load the assembly should be related to versioning.
switch to web.config
and add the assembly to it as bellow. make sure the DLL version is matching your application targeted .NET version.
for getting a public key you need to launch Developer Command Prompt for VS
. Change to GAC directory related framework on above ex C:\Windows\Microsoft.NET\Framework\v4.0.30319
and call
sn -T System.DirectoryServices.dll