title: ASP.NET web service using IUSR, not Application Pool Identity
body: <p>This question seems to be similar to this one: <a href="https://stackoverflow.com/questions/12785873/iis-site-not-using-identity-specified-in-app-pool-iis-7">IIS site not using identity specified in app pool IIS 7 +</a>
  However, there are no answers there.</p>
  
  <p>There's a tl;dr at the bottom.</p>
  
  <p>A thing to keep in mind is that I'm not the one who set up the server so they may have changed some settings I don't know about.</p>
  
  <p>We have an ASP.NET web service running on IIS 7. The web service is set to use DefaultAppPool, and the app pool's Identity is set to a domain user (let's say it's "localdomain\user1").</p>
  
  <p>The web service was unable to save to a certain network folder, so we gave localdomain\user1 read/write permissions to that folder. It still can't save there, however.</p>
  
  <p>I can't remote debug, and it works fine on my own computer (probably because it's running in Visual Studio's IIS express and my user does have access), so I tried to change the web service so that the error message contains the user name it's running under.</p>
  
  <p>If I use <code>Environment.UserName</code> to get it, the result is "IUSR". If I use <code>System.Security.Principal.WindowsIdentity.GetCurrent().Name</code>, it returns "NT AUTHORITY\IUSR".</p>
  
  <p>Unless the above methods are not reliable, the web service seems to be running under the default user (IUSR) and not the one set in its application pool. I can't figure out why, can anyone explain?</p>
  
  <p>EDIT: The Task Manager on the server, if I log in using RDP, shows that the w3wp.exe process IS being run by user1. I'm not sure which one to believe.</p>
  
  <p>Thank you.</p>
  
  <p><strong>tl;dr</strong>: The web service's application pool is set to a domain user, but it seems to be running under IUSR anyway. How do I prevent that?</p>