943,961 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 16568
  • ASP.NET RSS
Jun 17th, 2004
0

Unrecognized configuration section 'forms'

Expand Post »
How to fix this error?

I'm trying to use forms authentication to allow users to access different parts of a site and I have the following code in the web.config file:

<authentication mode="Forms" />
<forms
name=".MyCookie"
loginUrl="myaccount.aspx"
protection="All"
timeout="15"
path="/"/>

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: Unrecognized configuration section 'forms'

Source Error:


Line 38: -->
Line 39: <authentication mode="Forms" />
Line 40: <forms
Line 41: name=".MyCookie"
Line 42: loginUrl="myaccount.aspx"
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
maxtrixx is offline Offline
11 posts
since Jun 2004
Jun 18th, 2004
0

Re: Unrecognized configuration section 'forms'

You're closing the authentication section and then adding another authentication line ;-). Change it to this:

ASP.NET Syntax (Toggle Plain Text)
  1. <authentication mode="Forms">
  2. <forms name=".MyCookie" loginUrl="myaccount.aspx" protection="All" timeout="15" path="/"/>
  3. </authentication>
Moderator
Reputation Points: 322
Solved Threads: 28
The C# Man, Myth, Legend
Tekmaven is offline Offline
914 posts
since Feb 2002
Jul 2nd, 2008
0

Re: Unrecognized configuration section 'forms'

I am having the same issue as the other person in the thread. I am working with a product called IssueManager, I have converted from version 2 (VB) to version 4 which is in C#. I was able to solve many of the problems but i am stuck on the last 6...they all have the same error message:
Unrecognized configuration section authentication. (D:\Inetpub\wwwroot\QA\im4\web.config line 81)
Unrecognized configuration section membership. (D:\Inetpub\wwwroot\QA\im4\web.config line 85)
Unrecognized configuration section roleManager. (D:\Inetpub\wwwroot\QA\im4\web.config line 100)
Unrecognized configuration section compilation. (D:\Inetpub\wwwroot\QA\im4\web.config line 113)
Unrecognized configuration section httpHandlers. (D:\Inetpub\wwwroot\QA\im4\web.config line 130)
Unrecognized configuration section httpModules. (D:\Inetpub\wwwroot\QA\im4\web.config line 136)

sample of the first one:
Line 79: <!--Authentication @0-D74B60F9-->
Line 80:
Line 81: <authentication mode="Forms">
Line 82: <forms loginUrl="Login.aspx"/>
Line 83: </authentication>

I have checked the IIS settings and it is using ASP.NET 2.0. What other suggestion do you have? The code is generated by the conversion process using a product called CodeChargeStudio 4.0.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dmarino1 is offline Offline
9 posts
since Jul 2008
Jul 3rd, 2008
0

Re: Unrecognized configuration section 'forms'

I need you to post your entire web.config file. The issue goes deeper then what you've posted.

Also, what you've done is considered "thread hijacking". Proper netiquette states that if you have an issue, you should start your own thread instead of hijacking someone else's thread!
Moderator
Reputation Points: 322
Solved Threads: 28
The C# Man, Myth, Legend
Tekmaven is offline Offline
914 posts
since Feb 2002
Jul 3rd, 2008
0

Re: Unrecognized configuration section 'forms'

try with this code
ASP.NET Syntax (Toggle Plain Text)
  1. <authentication mode="Forms" >
  2.  
  3. <forms name=".MyCookie" loginUrl="myaccount.aspx"></forms>
  4.  
  5. </authentication>
Reputation Points: 12
Solved Threads: 34
Posting Whiz
sreein1986 is offline Offline
306 posts
since May 2008
Jul 9th, 2010
0
Re: Unrecognized configuration section 'forms'
Post the whole thing within <system.web> tag. something like this:

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

  <authentication mode="Forms">
    <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
  </authentication>
</system.web>
Last edited by pankhraj; Jul 9th, 2010 at 4:05 am.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pankhraj is offline Offline
1 posts
since Jul 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Pls help regarding C# / AJAX dynamic control creation
Next Thread in ASP.NET Forum Timeline: dynamic label





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC