Access is denied.
Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.
Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance. Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET > Version:4.0.30319.18010
I followed the simple tutorial from here, ran the application and received this message.
Check your project properties and ensure that Anonymous Authentication = Enabled. If you have <authentication mode="Windows" />
in your web.config, you will also need to set Windows Authentication = Enabled for the project (click the project in Solution Explorer):
The effect this has is to change the project file (.csproj) from saying:
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
To:
<IISExpressAnonymousAuthentication>enabled</IISExpressAnonymousAuthentication>
<IISExpressWindowsAuthentication>enabled</IISExpressWindowsAuthentication>
So you can also do this by hand, or fix it permanently by modifying the intranet project template.
So I just wanted to chime in on something that worked for me. I created a new "ASP.Net MCV 4 Web application" and used the "Intranet Application" project template. I had to enable "Windows Authentication". I assume this is because I chose the intranet application template versus the internet application template.
Basically first allow users or rolse access
Default web.config denies access
<authorization>
<deny users="?" />
</authorization>
so make sure you allow yourself
<authorization>
<allow users="domain\User" />
<deny users="?" />
</authorization>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With