hi all,

I work on visual studio 12 express with asp.net mvc4 web + telerik contolers. we have share our code using svn but run project on own visual studeio server which starts when run the project.

Everything worked fine but after updating code fewdays back after one of my friend commite his code.since then I got following error.

HTTP Error 401.2 - Unauthorized
You are not authorized to view this page due to invalid authentication headers.
he had newly add membership managment.

then i deleted all my code from my machine and got a update but still I get same error.

can anybody give me a hint to solve this. I am newbi to asp.net widnows environment.

thx in advacne

Dani AI

Generated

Good troubleshooting by — enabling Anonymous Authentication in the project properties is a common quick fix for a local 401.2. Briefly: HTTP Error 401.2 means the server rejected the authentication headers (a mismatch between what IIS/IIS Express expects and what the app supplies). In an IIS Express + Visual Studio workflow this often shows up after a commit that added membership/authorization code or changed web.config authentication/authorization entries.

Useful diagnostic checklist and clarifications:

  • Project settings: the Web (Servers) page in the project Properties controls the IIS Express authentication toggles. Enabling Anonymous there will allow requests to proceed when no other auth is configured.
  • Configuration files: inspect web.config for both the <system.webServer> authentication nodes and the <system.web> <authentication>/<authorization> entries (these can override or conflict with IIS settings).
  • Code changes: look for a new global filter (e.g. adding an Authorize filter in Global.asax) or controller-level [Authorize] attributes that would block anonymous requests after the membership code was added. Use an SVN diff to pinpoint what the friend’s commit changed (web.config, Global.asax, filters, startup code).
  • Server vs. dev differences: if the app will require login in production, don’t rely on leaving Anonymous enabled — instead configure the intended scheme (Forms/Windows) consistently in IIS and web.config.

Example of the IIS-level authentication section that can be present in web.config:

<system.webServer>
  <security>
    <authentication>
      <anonymousAuthentication enabled="true" />
      <windowsAuthentication enabled="false" />
    </authentication>
  </security>
</system.webServer>

Operational notes: enabling Anonymous is fine for local debugging but production sites should implement and test the intended auth scheme and use explicit [AllowAnonymous] where public access is required. To narrow the root cause, examine the 401 response headers (WWW-Authenticate) with browser devtools or Fiddler and compare the exact SVN commit that introduced the membership/authorization changes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.