Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.NET forms authentication error

Status
Not open for further replies.

Ross1811

MIS
Oct 1, 2004
122
US
Hi everyone,


Bare with me I am new at ASP.NET. I created this form and config file, to use forms authentication I get this 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 2: <system.web>
Line 3: <customErrors mode="Off"/>
Line 4: <authentication mode="Forms">
Line 5: <forms name="AuthCookie"
Line 6: path="/"

My code on the other hand looks like this in the web.config file,


<configuration>
<system.web>
<customErrors mode="Off"/>
<authentication mode="Forms">
<forms name="AuthCookie"
path="/"
loginUrl="login.aspx"
protection="All"
timeout="30">
<credentials passwordFormat="Clear">
<user name="jeff" password="test" />
<user name="mike" password="test" />
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>



Not sure what is going on here, any help would be appreciated,


Thanks,
Ross

 
Hi,

I am assuming your site is local at the moment.

You have to define your site as a 'virtual directory'

Open up IIS > Local > Web sites > default web sites >
Find your site > Right click > Properties > where it says 'application settings' > Click 'create' > apply > OK

You should be OK now.

J

----------------------------------------------------------------------------------------
Try saying Tek-Tips Tek-Tips Tek-Tips more than 3 times in a row....no chance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top