title: Why do i get i:0#.w|domain\\username and within RunWithElevatedPrivileges domain\apppool?
body: <p>When i do</p>
  
  <pre><code>Console.WriteLine(SPContext.Current.Web.CurrentUser.LoginName);
  </code></pre>
  
  <p>i get the following response:</p>
  
  <pre><code>i:0#.w|domain\\username
  </code></pre>
  
  <p>When i do</p>
  
  <pre><code>SPSecurity.RunWithElevatedPrivileges(delegate() {
      Console.WriteLine(SPContext.Current.Web.CurrentUser.LoginName);
  });
  </code></pre>
  
  <p>i get</p>
  
  <pre><code>domain\appPoolAccount
  </code></pre>
  
  <p>without <code>i:0#.w|</code>... within the loginname.</p>
  
  <p>Is someone able to explain why this happens?</p>