title: ASP.NET MVC 3 application redirects to /Account/Logon for all pages, how do I stop it?
body: <p>I'm trying to deploy an ASP.NET MVC 3 application from my development machine to another workstation. The versions of ASP.NET MVC are the same (3.0.20105), the versions of IIS are the same (7.5.7600.16385), and as far as I can tell the installed versions of the .NET framework are the identical. However, on my dev machine only the routes which hit an <code>[Authorize]</code> attribute actually redirect to <code>~/Account/Logon</code>, but on the target machine <em>every</em> file I try to access redirects me to <code>~/Account/Logon</code> (even when I try to access image or stylesheet assets).</p>
  
  <p>I've already seen this question but it doesn't solve the problem for me :</p>
  
  <p><a href="https://stackoverflow.com/questions/5009565/asp-net-mvc3-and-windows-auth-on-iis-keeps-redirecting-to-account-login">ASP.NET MVC3 and Windows Auth on IIS keeps redirecting to /Account/Login</a></p>
  
  <p>I've also tried adding these, but no joy :</p>
  
  <pre><code>&lt;add key="autoFormsAuthentication" value="false" /&gt;
  &lt;add key="enableSimpleMembership" value="false" /&gt;
  </code></pre>
  
  <p>Any other ideas?</p>
  
  <p>In case it helps, here's the web.config - it's pretty much unchanged from when I initially created the project :</p>
  
    
  
  <p>
      
        
        
        
        
        
        
      </p>
  
  <pre><code>&lt;system.web&gt;
    &lt;compilation debug="true" targetFramework="4.0"&gt;
      &lt;assemblies&gt;
        &lt;add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
        &lt;add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
        &lt;add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
        &lt;add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
        &lt;add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
      &lt;/assemblies&gt;
    &lt;/compilation&gt;
  
    &lt;authentication mode="Forms"&gt;
      &lt;forms loginUrl="~/Account/LogOn" timeout="2880" /&gt;
    &lt;/authentication&gt;
  
    &lt;pages&gt;
      &lt;namespaces&gt;
        &lt;add namespace="System.Web.Helpers" /&gt;
        &lt;add namespace="System.Web.Mvc" /&gt;
        &lt;add namespace="System.Web.Mvc.Ajax" /&gt;
        &lt;add namespace="System.Web.Mvc.Html" /&gt;
        &lt;add namespace="System.Web.Routing" /&gt;
        &lt;add namespace="System.Web.WebPages"/&gt;
      &lt;/namespaces&gt;
    &lt;/pages&gt;
  &lt;/system.web&gt;
  
  &lt;system.webServer&gt;
    &lt;validation validateIntegratedModeConfiguration="false"/&gt;
    &lt;modules runAllManagedModulesForAllRequests="true"/&gt;
  &lt;/system.webServer&gt;
  </code></pre>
  
  <p></p>
  
  <p>And in case this helps, the web.config from the Views folder, though this again is (as far as I can tell) unchanged : </p>
  
    
  
  <p>
      
        
          
          
        
      </p>
  
  <pre><code>&lt;system.web.webPages.razor&gt;
    &lt;host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
    &lt;pages pageBaseType="System.Web.Mvc.WebViewPage"&gt;
      &lt;namespaces&gt;
        &lt;add namespace="System.Web.Mvc" /&gt;
        &lt;add namespace="System.Web.Mvc.Ajax" /&gt;
        &lt;add namespace="System.Web.Mvc.Html" /&gt;
        &lt;add namespace="System.Web.Routing" /&gt;
        &lt;add namespace="System.Data.Entity" /&gt;
      &lt;/namespaces&gt;
    &lt;/pages&gt;
  &lt;/system.web.webPages.razor&gt;
  
  &lt;appSettings&gt;
    &lt;add key="webpages:Enabled" value="false" /&gt;
  &lt;/appSettings&gt;
  
  &lt;system.web&gt;
    &lt;httpHandlers&gt;
      &lt;add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/&gt;
    &lt;/httpHandlers&gt;
  
    &lt;pages
        validateRequest="false"
        pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"&gt;
      &lt;controls&gt;
        &lt;add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" /&gt;
      &lt;/controls&gt;
    &lt;/pages&gt;
  &lt;/system.web&gt;
  
  &lt;system.webServer&gt;
    &lt;validation validateIntegratedModeConfiguration="false" /&gt;
  
    &lt;handlers&gt;
      &lt;remove name="BlockViewHandler"/&gt;
      &lt;add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" /&gt;
    &lt;/handlers&gt;
  &lt;/system.webServer&gt;
  </code></pre>
  
  <p></p>