Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Express gives Access Denied error when debugging ASP.NET MVC

I have created an ASP.NET MVC 3 project, and am using IIS Express as the web server when developing. When I try to debug, I get the error message below.

How can this be solved?

Server Error in '/' Application.

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.

like image 758
Kris-I Avatar asked Jan 29 '12 13:01

Kris-I


People also ask

How do I debug MVC in IIS?

To start debugging, select the profile name in the toolbar, such as <project profile name>, IIS Express, or <IIS profile name> in the toolbar, select Start Debugging from the Debug menu, or press F5. The debugger pauses at the breakpoints. If the debugger can't hit the breakpoints, see Troubleshoot debugging.

How do I enable IIS Express in Visual Studio?

Configure IIS express on visual studioSelect the web application project and open properties -> select the web tab -> under server's select IIS express-> Specify the project URL. Now open the project folder and . vs folder (Hidden) -> Config -> applicationhost.


2 Answers

If you are using Visual Studio, you can also left-click on the project in Solution Explorer and change the Windows Authentication property to Enabled in the Properties window.

like image 60
Jason Avatar answered Sep 21 '22 05:09

Jason


The cause if had for this problem was IIS Express not allowing WindowsAuthentication. This can be enabled by setting

<windowsAuthentication enabled="true"> 

in the applicationhost.config file located at C:\Users[username]\Documents\IISExpress\config.

like image 21
Ant Swift Avatar answered Sep 25 '22 05:09

Ant Swift