Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8426631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:34:55+00:00 2026-06-10T04:34:55+00:00

I have an MVC4 application been developed in VS2012 that uses forms authentication. [authentication

  • 0

I have an MVC4 application been developed in VS2012 that uses forms authentication.

[authentication mode="Forms"]
  [forms loginUrl="~/Account/Login" timeout="2880" /]
[/authentication]

It’s using the default IIS 8.0 Express.

Every time I open and run the app from within the VS I got the message:

HTTP Error 401.2 – Unauthorized

You are not authorized to view this page due to invalid authentication headers.

I found out that to avoid this screen I have to change to ‘true’ the anonymousAuthentication and windowsAuthentication keys of the Security section of the applicationhost.config file at the [User Documents]\IISExpress\config folder to:

[system.webServer]
  [security]
    [authentication]
      [anonymousAuthentication enabled="true" /]
      [windowsAuthentication enabled="true" /]
    [/authentication]
  [/security]
[/system.webServer]

But every time I reopen the solution in VS the keys are reset to false.

How can I make then permanently set to true?

I’ve tried to put those key in the application’s web.config but then I receive the message:

HTTP Error 500.19 – Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

Any help folks?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T04:34:56+00:00Added an answer on June 10, 2026 at 4:34 am

    If the problem is that Visual Studio updates the two settings in the applicationhost.config when opening the solution, you can solve it by selecting the Project in the Solution Explorer, view the Properties pane (available when you’re not in debug mode) and set to Enabled the two items Anonymous Authentication and Windows Authentication.

    By the way, in my case the parameter generating the 401.2 error was just Anonymous Authentication, you might want to try to leave the default one for Windows Authentication.

    (PS, your post solved the problem for the 401.2 and really saved my day so many thanks for it!)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been writing an application using ASP.Net MVC4, where the majority of the
I have a MVC4 application that is calling Amazon Web Services. The amazon service
I have a dynamic MVC4, jQuery Mobile application that works for the most part
I have an asp.net MVC4 application that I am using Unity as my IoC.
I have an mvc4 application that I am looking at hosting on azure websites.
I have an MVC4 web application In setting it up on IIS7.5 I added
I am creating a MVC4 application and I have got some troubles when I
I am currently working on MVC4 SinglePage Application. I have a Web Api method
I have a simple MVC 4 (Beta) Application and just observed something that I
I have a layered web application that I built with ASP.NET MVC 4, WebAPI

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.