Authentication mode=”Forms” Error

asp.netauthentication

I've made an ASP.net application 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?

Thanks,
Vincent

Best Answer

"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 IIS admin console, go to directory properties and do a "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.