I have a web service added by service reference (called "MyServiceReferences") in my ASP .NET MVC 4 solution. Also I have an Active Directory service in another project in the same solution. I am trying to display user name (First name and Last name) in my web page using active directory users information. The problem is when I call
PrincipalSearcher.FindAll()
, it works sometimes. The exception I am getting is
Could not load file or assembly 'MyServiceReferences.XmlSerializers' or one of its dependencies. The system cannot find the file specified.
In my project build setting I have tried to set Generate serialization assembly "On". But it did not solve my problem.