I have a Application in Asp.net MVC running perfectly in Visual Studio 2015, with IIS EXPRESS (local computer).
I try execute this application in other computer (Windows Server 2008 R2 w/ IIS 7.5). I did a Deploy and i put in folder "C:\inetpub\wwwroot\testsite".
On execute localhost/testsite, the index page showying normaly, but, on submit the form (it's a login page), my IIS presents the "401.0 ERROR".
I am using "authentication mode forms":
<system.web>
<compilation debug="true" targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5.2" />
<authentication mode="Forms">
<forms loginUrl="~/User/Login" timeout="2880" />
</authentication>
</system.web>
Pool application is "DefaultAppPool". The Authentication: "Anonymous = ON", "Forms = ON", others options = OFF.
I tried various tips from other posts here from StackOverflow, But I could not solve my problem =(
Thanks!
Best Answer
Select the web application returning
401 - Unauthorized,
and double-click the Authentication feature. Right-click the "Anonymous Authentication" provider and select edit. Switch the default anonymous user account ("IUSR") to ApplicationPoolIdentity. Now, right-click the web application in the left pane, select Edit Permissions..., select the Security tab, click Edit -> Add and addIIS APPPOOL\NameOfAppPool
. Make sure the Application Pool Identity has read and execute permissions of the folder.If you want to enable logging, check out this TechNet article: http://technet.microsoft.com/en-us/library/cc754631(WS.10).aspx
There is a setting for the
anonymous user
to use the credentials of theapplication pool identity
or a specific user. Sometimes, it is defaulted to a specific user and notanonymous user
If this is the issue in your case, following settings will hopefully fix it: