text: I have an asp app with C# back end. running .net 4.5. I am using System.DirectoryServices.AccountManagement; and it compiles and runs fine straight out of VS, but when I publish it and go to the page I get an error
  Compilation Error
  Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
  Compiler Error Message: CS0234: The type or namespace name 'AccountManagement' does not exist in the namespace 'System.DirectoryServices' (are you missing an assembly reference?)
  Source Error:
  Line 5: using System.Net;
  Line 6: using System.Globalization;
  Line 7: using System.DirectoryServices.AccountManagement;
  Line 8: /// <summary>
  Line 9: /// Summary description for ldapThirty
  I have never seen this out side of VS. The reference is in the project. I am using 2017. I see there is an option to copy local, but I cant find it. Any help would be appreciated.
  Hi quarinteen,
  This issue occur because your system.directoryservices.accountmanagement.dll is not copied to the local bin folder. So you need to set
  copy to local=true in reference's properties.
  Best Regards,
  Yuk Ding