Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 7th, 2009, 03:43 AM
Authorized User
 
Join Date: Jul 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default <section> error in web.config file

hi everyone i'm trying to compile my application but it gives this error."Asp.net 2.0 runtime error section must appear only once per config file see topic <Section> for exceptions"

here's how my web.config file looks like.

<?xmlversion="1.0"?>
<
configuration>
<
appSettings>
<
addkey="Image"value="C:\Generating Word Document\Images\"/>
<
addkey="WordDoc"value="C:\Generating Word Document\Document\"/>
<
addkey="WordMod"value="C:\\Generating Word Document\\Template\\"/>
<
addkey="EmailToAddressForErrors"value="[email protected]" />
<
addkey="EmailFromAddressForErrors"value="[email protected]" />
<
addkey="SendMailOnErrors"value="False" />
</
appSettings>

<
connectionStrings>
<
addname="Sql"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\EDM.mdf;Integrated Security=True;User Instance=True;"/>
</
connectionStrings>
<
system.web>
<
membership>
<
providers>
<
clear />
<
addname="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="BugBase"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="/"
requiresUniqueEmail="true"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
/>
</
providers>
</
membership>

<
roleManagerdefaultProvider="SqlProvider"
enabled="true"
cacheRolesInCookie="true"
cookieName=".ASPROLES"
cookieTimeout="30"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
cookieProtection="All"
>
<
providers>
<
add
name="SqlProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="BugBase"
/>
</
providers>
</
roleManager>
<
siteMapdefaultProvider="XmlSiteMapProvider"enabled="true">
<
providers>
<
addname="XmlSiteMapProvider"
description="Default SiteMap provider."
type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
siteMapFile="Web.sitemap"
securityTrimmingEnabled="true" />
</
providers>
</
siteMap>

<
caching>
<
sqlCacheDependencyenabled="true"pollTime="1000" >
<
databases>
<
addname="EDM"connectionStringName="Sql" />
</
databases>
</
sqlCacheDependency>
</
caching>
<
authenticationmode="Forms">
<
formsloginUrl="~/Login.aspx" />
</
authentication>
<
authorization>
<
denyusers="?" />
</
authorization>
<
customErrorsmode="Off"defaultRedirect="GenericErrorPage.htm">
<
errorstatusCode="403"redirect="NoAccess.htm"/>
<
errorstatusCode="404"redirect="FileNotFound.htm"/>
</
customErrors>

<
compilationdebug="true">
<
assemblies>
<
addassembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies></compilation>
<
authenticationmode="Windows"/>

</
system.web>

<
locationpath="Maintenance">
<
system.web>
<
authorization>
<
allowroles="Administrator" />
<
denyusers="*"/>
</
authorization>
</
system.web>
</
location>
<
locationpath="Reporting">
<
system.web>
<
authorization>
<
allowroles="Manager" />
<
denyusers="*"/>
</
authorization>
</
system.web>
</
location>
<
locationpath="Logout.aspx">
<
system.web>
<
authorization>
<
allowusers="*" />
</
authorization>
</
system.web>
</
location>

<
locationpath="Images">
<
system.web>
<
authorization>
<
allowusers="*" />
</
authorization>
</
system.web>
</
location>

<
system.net>
<
mailSettings>
<
smtpdeliveryMethod="Network">
<
networkhost=[email protected]port="25" />
</
smtp>
</
mailSettings>
</
system.net>

</
configuration>

anyone who knows why, please let me know. Thanks in advance
__________________
supertedz
 
Old May 7th, 2009, 11:16 AM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

You have both <authentication mode="Forms"> and <authentication mode="Windows"/>. You can only have one <authentication> section.

Get rid of the <authentication mode="Windows"/> line and you should be all set.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting changes to <app>.config Jeff Mason .NET Framework 2.0 2 July 4th, 2008 02:13 PM
web.config <compilation> <assemblies> Jophie BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 January 10th, 2008 12:04 PM
Web.Config xmlns for <configuration> mhardiman BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 July 9th, 2006 11:08 AM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
<marquee><b>About CHAT App. in PHP4</b></marquee> Ramkrishna PHP How-To 1 September 11th, 2004 07:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.