Form Authentication error in IIS

\[code\]Server Error in '/' Application.Configuration ErrorDescription: 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 59: ASP.NET to identify an incoming user. Line 60: -->Line 61: <authentication mode="Forms">Line 62: <forms loginUrl="Login.aspx" name=".ASPXAUTH" defaultUrl="Login.aspx" protection="All" path="/"></forms>Line 63: </authentication>Source File: D:\Etool Project\ERecruitmentfinal2\WebClient\web.config Line: 61 Show Additional Configuration Errors: D:\Etool Project\ERecruitmentfinal2\WebClient\web.config \[/code\]this is the error i am getting while configuring the files in iis as virtual directory.I tried to configure the virtual directory in iis and make the form authentication to be enabled but it also showing the error: Configuration section not allowed to be set below applicationMy web.config file is\[code\]<?xml version="1.0" encoding="UTF-8"?><configuration> <appSettings> <add key="smtpcon" value="http://stackoverflow.com/questions/15584114/smtp.gmail.com"></add> <add key="USERNAME" value="http://stackoverflow.com/questions/15584114/[email protected]"></add> <add key="PASSWORD" value="http://stackoverflow.com/questions/15584114/Hrms123$"></add> <add key="LogAudit" value="http://stackoverflow.com/questions/15584114/true"></add> <add key="PhotoURL" value="http://localhost/photo/"></add> </appSettings> <connectionStrings> <add name="PORTAL" providerName="System.Data.SqlClient" connectionString="Password=sql;User ID=sa;Data Source=(local);database=Etool;" /> </connectionStrings> <location path="Css"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> <location path="Js"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> <location path="images"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> <location path="ForgotPassword.aspx"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> <system.web> <!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development. --> <compilation debug="true" targetFramework="4.0"> <assemblies> <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> </assemblies> </compilation> <!-- The <authentication> section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. --> <authentication mode="Forms"> <forms loginUrl="Login.aspx" name=".ASPXAUTH" defaultUrl="Login.aspx" protection="All" path="/"></forms> </authentication> <machineKey validationKey="282487E295028E59B8F411ACB689CCD6F39DDD21E6055A3EE480424315994760ADF21B580D8587DB675FA02F79167413044E25309CCCDB647174D5B3D0DD9141" decryptionKey="8B6697227CBCA902B1A0925D40FAA00B353F2DF4359D2099" validation="SHA1" /> <authorization> <deny users="?" /> <allow users="*" /> </authorization> <!-- The <customErrors> section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace. <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors> --> <httpRuntime requestValidationMode="2.0" /> <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" validateRequest="false" /> </system.web> <system.webServer> <defaultDocument> <files> <add value="http://stackoverflow.com/questions/15584114/login.aspx" /> </files> </defaultDocument> <directoryBrowse enabled="true" /> </system.webServer></configuration>\[/code\]
 
Back
Top