Cody Jones
Cody Jones

Reputation: 432

why is my website throwing me Authentication Mode=windows error

When I load my web page its giving me this error, I just published it from visual studio, where it was function perfectly fine and now its giving me an error.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:

Line 87:             ASP.NET to identify an incoming user. 
Line 88:         -->
Line 89:      <authentication mode="Windows"/>
Line 90:      <!--
Line 91:             The <customErrors> section enables configuration 

Upvotes: 3

Views: 15693

Answers (2)

Shobhit Saxena
Shobhit Saxena

Reputation: 1

delete all code in web.config and paste

<?xml version="1.0"?>

<configuration>

  <connectionStrings>
    <add name="your connection string name" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\your database name;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>

  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
  </system.web>

</configuration>

it will work.

Upvotes: -2

Midhun Mundayadan
Midhun Mundayadan

Reputation: 3182

Whenever a new web application created, using Visual Studio.net it automatically creates a virtual directory in IIS and configures as an application. So you have to manually create a Virtual directory and configure it to application.

Start->All program-mes->Administrative tools->Internet Information service-> Select Server name->Web Site->Default Web site-> right click ->new->virtual directory

this opens a virtual directory wizard. give a name, give path of application. Give appropriate permission. then Finish.

Now to cross check whether its configured to an application or not, select created virtual directory Right click->properties->Select Virtual directory under "Application settings"

http://blogs.msdn.com/b/robgruen/archive/2005/09/12/464196.aspx

Upvotes: 7

Related Questions