title: Windows Authentication in IIS 7.5 Fails with Trust Relationship Exception
body: <p>I have an ASP.Net 2.0 application that uses integrated Windows Authentication to authenticate/authorize users.  The application works fine on Windows XP/IIS 5.1, Windows Server 2008/IIS 7, and Windows Vista/IIS 7.  When I try to run this application on Windows 7/IIS 7.5, I get the following exception: <code>The trust relationship between this workstation and the primary domain failed.</code></p>
  
  <p>The stack trace is as follows:  </p>
  
  <pre><code>[SystemException: The trust relationship between this workstation and the primary domain failed.
  ]
     System.Security.Principal.NTAccount.TranslateToSids(IdentityReferenceCollection sourceAccounts, Boolean& someFailed) +1085
     System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess) +46
     System.Security.Principal.WindowsPrincipal.IsInRole(String role) +128
     System.Web.Configuration.AuthorizationRule.IsTheUserInAnyRole(StringCollection roles, IPrincipal principal) +229
     System.Web.Configuration.AuthorizationRule.IsUserAllowed(IPrincipal user, String verb) +354
     System.Web.Configuration.AuthorizationRuleCollection.IsUserAllowed(IPrincipal user, String verb) +245
     System.Web.Security.UrlAuthorizationModule.OnEnter(Object source, EventArgs eventArgs) +11153304
     System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
     System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171
  </code></pre>
  
  <p>The web.config file contains the following information related to authentication/authorization:</p>
  
  <pre><code>&lt;authentication mode="Windows" /&gt;
  &lt;authorization&gt
    &lt;!--Deny anonymous users--&gt
    &lt;deny users="?"/&gt
    &lt;allow roles="domain\GroupWithAccess"/&gt
    &lt;deny users="*"/&gt
  &lt;/authorization&gt
  </code></pre>
  
  <p>Most of the results I found when researching this error state that the problem is related to a broken computer account in the domain and list the solution as re-joining the domain.  I've done this but the error still appears.  "Normal" domain operations work fine (accessing UNC shares, logging in, etc.).</p>
  
  <p>This application runs in the Classic .Net AppPool for compatibility reasons.  I tried changing the identity of the AppPool to "NetworkService" but the error still persists.</p>
  
  <p>Any help is greatly appreciated.</p>