I\'m running MVC3 and a windows auth web application. When I deploy to IIS6 it runs great until I hit a page that requires authentication. It then is auto-redirecting to /
Try override WebMatrix.dll default for login url by adding this to your appSettings (web.config) :
<add key="loginUrl" value="~/Account/LogOn"/>
WebMatrix.dll set the login Url to /Account/Login, if this key isn't set in the config file... It works for me.
Not sure if you still have the issue or not, but try adding
<add key="autoFormsAuthentication" value="false" />
to your web.config under appSettings. According to here and here, that should solve your problem.
In RTM try to add to <appSettings>
in Web.config
:
<add key="enableSimpleMembership" value="false" />
(Thx to Problem exclusively using Windows Authentication in ASP.NET MVC 3 Beta.)
You can also go to the IIS on the server and go into Authentication modes and disable forms authentications.
This has me scratching my head in a demo. Embarassing.
In RTM try to add to in Web.config:
<add key="enableSimpleMembership" value="false" />
The above post works. +1 Add this key before adding deployable dependencies.
In MVC for the 4.6 Framework this is done in 2 ways, the first is in the Web.Config as you would expect, the second one is done in the projectfile and is used to configure IIS Express:
<PropertyGroup>
..
<IISExpressAnonymousAuthentication>enabled</IISExpressAnonymousAuthentication>
<IISExpressWindowsAuthentication>disabled</IISExpressWindowsAuthentication>
</Property
Will disable Windows authentication and use anonymous when developing but is not used for the deploying the application.