Posted on: 9/12/2013 11:14:27 PM | Views : 664

My class below gives a null domainContext therefore PrincipalContext fails on nullreferenceException when deployed to Dev and QA web server.   The same code works fine on my local.  On the web server I switched my application pool account from Network Service to a domain account and the app stopped errorring out but it would always return this application pool account vs. the Windows authenticated user account.  I appreciate it if someone can shed some light here.

using System.DirectoryServices.AccountManagement; using System.Security.Principal;     public partial class _Default : System.Web.UI.Page     {         protected void Page_Load(object sender, EventArgs e)         {         }         protected void btnAdddonotcall_Click(object sender, EventArgs e)         {     ...

Go to the complete details ...