Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

authentication mode="Forms" Error

Tags:

asp.net

I've made an ASP.NETapplication in Visual Studio. When it was ready I did "Publish Website". I placed the created folder on my website.

When I go to the application on my site, I get the following error:

Server Error in '/' Application.

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 47:      ASP.NET to identify an incoming user. 
Line 48:      -->
Line 49:      <authentication mode="Forms" />
Line 50:      
Line 51:      <customErrors mode="Off">

Source File: \CLST_SMB1IIS\WebfarmData$\WebData\winckelmans.net\wwwroot\bookstore\web.config Line: 49

How do I solve this?

like image 745
Vinzcent Avatar asked Sep 10 '10 09:09

Vinzcent


People also ask

How do I enable form authentication?

To configure forms authentication by using the UIOpen IIS Manager and navigate to the level you want to manage. In Features View, double-click Authentication. On the Authentication page, select Forms Authentication. In the Actions pane, click Enable to use Forms authentication with the default settings.

What is .NET forms authentication?

Forms authentication enables user and password validation for Web applications that do not require Windows authentication. With forms authentication, user information is stored in an external data source, such as a Membership database, or in the configuration file for an application.

What is authentication mode in web config?

Windows Authentication mode provides the developer to authenticate a user based on Windows user accounts. This is the default authentication mode provided by ASP.Net. You can easily get the Identity of the user by using User.Identity.Name. This will return the computer name along with the user name.


1 Answers

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.

As it says, the Virtual Directory is not being configured as an ASP.NET application.

You may have to go to your IIS admin console, go to the directory properties and select "Create Application". To do so:

  • Open the IIS Administration Console on the server where the application is published
  • Right click on the Virtual Directory where the application files are published
  • Select Properties, then a "Main Properties" dialog pops up.
  • There is a "Application Settings" section. Just hit "Create" in front of the "Application Name" textbox, then hit "Ok"
  • Check that the Virtual Directory appears with a different icon, it should be ok now.
like image 96
Larry Avatar answered Oct 06 '22 01:10

Larry