Click here to Skip to main content
16,018,460 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Error: Sections must only appear once per config .
pls help me out on this error!

code:


XML
<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
    <appSettings>
        <add key="DataProvider" value="System.Data.SqlClient"/>
        <add key="ConnectionString" value="Data Source=10.10.10.144;Initial Catalog=clientbackup;User ID=sa;Password='supp0rt';Pooling=False"/>
        <add key="CuteWebUI.AjaxUploader.UploadSpeedKB" value="100"/>
        <add key="CuteWebUI.AjaxUploader.TempDirectory" value="C:\\"/>
    </appSettings>
    <connectionStrings>
        <add name="ConnectionString" connectionString="Data Source=10.10.10.144;Initial Catalog=clientbackup;User ID=sa;Pooling=False" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>
        <pages enableEventValidation="false">
            <controls>
                <add namespace="CuteWebUI" assembly="CuteWebUI.AjaxUploader" tagPrefix="CuteWebUI"/>
            </controls>
        </pages>
        <httpModules>
            <add name="CuteWebUI.UploadModule" type="CuteWebUI.UploadModule,CuteWebUI.AjaxUploader"/>
        </httpModules>
        <!--
            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">
            <assemblies>
                <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Windows.Forms, Version=2.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="Windows"/>
        <!--
            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>
        -->
    </system.web>
</configuration>
Posted

This error appears, If the website is not marked as web application in IIS. for this -> Go to IIS ->Right click your project, Properties ->Click on remove.

If 2 web.config files are present in the same folder.

Please remove one if 2 web.config files are present.
 
Share this answer
 
Comments
abenijami 22-May-10 4:16am    
thank you but its not working and we have only one webconfig file in our project.
The error is self explanatory. You cannot have one section defined twice in a web.config file.
Remove the line:
XML
<add key="ConnectionString" value="Data Source=10.10.10.144;Initial Catalog=clientbackup;User ID=sa;Password='supp0rt';Pooling=False"/>

from
XML
<appSettings> </appSettings>

section. It should work. :thumbsup:

*edit - added explanation.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900