Access denied error with MVC site

If your new MVC site throws an access denied error you probably don’t have windows authentication setup.

The first thing is checking if you are hosting your site on IIS 7 or better. (Otherwise this section won’t help).
Right click on your project in Visual Studio, click Properties.
Click the web tab.
If you Use IIS Express checked THEN SKIP TO THE BOTTOM OF THIS ARTICLE.
image

Open IIS Manager (Start –> Administrative Tools –> Internet Information Services (IIS) Manager).
Navigate to your website (usually Default Web Site) and click on it.
image

Double click Authentication.
If you don’t see Windows Authentication then it’s not setup.
image

See this post about enabling windows authentication.
(You may need to close IIS Manager and reopen it).

4. In the Actions pane, click Enable to use Windows authentication.
image

5. On the Authentication page, select Anonymous authentication.

6. In the Actions pane, click Disable to disable anonymous authentication.
image

Here is how to enable windows authentication on IIS Express in Visual Studio 2012.
1. Click on your project in the Solution Explorer to select the project.
2. If the Properties pane is not open, open it (F4).
3. In the Properties pane for your project:
a) Set “Anonymous Authentication” to “Disabled”.
image

b) Set “Windows Authentication” to “Enabled”.
image

[tweetmeme only_single=”false”]
Advertisements

Got something to add?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s