简体   繁体   中英

Configuration Error

I am getting following error while running my application which is asp.net.

Server Error in '/ASPMassShop' Application.

"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: Child nodes not allowed.

Source Error:

Line 126:       <compilers>
Line 127:           <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
Line 128:               <providerOption name="CompilerVersion" value="v3.5"/>
Line 129:               <providerOption name="WarnAsError" value="false"/>
Line 130:           </compiler>

Source File: D:\ASPMass_Source.0.1\ASPMassShop\web.config Line: 128


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 "

Following is my web.config

<?xml version="1.0"?>
<configuration>
    <configSections>
        <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                </sectionGroup>
            </sectionGroup>
        </sectionGroup>
    </configSections>
    <RewriterConfig>
        <Rules>
            <RewriterRule>
                <LookFor>^/default\.aspx$</LookFor>
                <SendTo>/default.aspx</SendTo>
            </RewriterRule>
            <RewriterRule>
                <LookFor>^/([a-zA-Z0-9-]+)\.aspx$</LookFor>
                <SendTo>/Categories/Category.aspx?Category=$1</SendTo>
            </RewriterRule>
            <RewriterRule>
                <LookFor>^/([a-zA-Z0-9-]+)/([0-9]+)\.aspx$</LookFor>
                <SendTo>/Categories/Category.aspx?Category=$1&amp;PageID=2</SendTo>
            </RewriterRule>
            <RewriterRule>
                <LookFor>^/([a-zA-Z0-9-]+)/([0-9]+)/(NameDown|NameUp|PriceDown|PriceUp)\.aspx$</LookFor>
                <SendTo>/Categories/Category.aspx?Category=$1&amp;PageID=$2&amp;Sort=$3</SendTo>
            </RewriterRule>
            <RewriterRule>
                <LookFor>^/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)\.aspx$</LookFor>
                <SendTo>/Products/Product.aspx?Category=$1&amp;Item=$2</SendTo>
            </RewriterRule>
        </Rules>
    </RewriterConfig>
    <appSettings>
        <add key="SiteName" value="ASPMass Shopping Cart"/>
        <add key="SiteUrl" value="http://localhost:3156"/>
        <add key="SiteDir" value="E:\work\ASPMass\ASPMassShop"/>
        <add key="Currency" value="USD"/>
        <add key="ProductsPerPage" value="10"/>
        <add key="PayPal_Email" value="yourpaypalemail@youremail.com"/>
        <add key="PayPal_Return" value="http://localhost:2324/Orders/OrderStep4.aspx"/>
        <add key="PayPal_Cancel" value="http://localhost:3156/Orders/Payment/Payment.aspx?Payment=PayPal"/>
        <add key="PayPal_Currency" value="USD"/>
        <add key="PayPal_URL" value="https://www.sandbox.paypal.com/cgi-bin/webscr"/>
        <add key="MaxTopProducts" value="100"/>
        <add key="Version" value="0.2"/>
        <add key="ActivateNewUsers" value="True"/>
        <add key="SearchExpiration" value="1440"/>
        <add key="CatImgWidth" value="40"/>
        <add key="CatImgHeight" value="40"/>
        <add key="ManufImgWidth" value="70"/>
        <add key="ManufimgHeight" value="30"/>
        <add key="SMTPServer" value="localhost"/>
        <add key="SMTPPort" value="25"/>
        <add key="SMTPUser" value="admin"/>
        <add key="SMTPPass" value="admin"/>
        <add key="NewsletterEmail" value="no_reply@aspmass.com"/>
    </appSettings>
    <connectionStrings>
        <!--<add name="CartDBConnection" connectionString="Data Source=HAMBUGADA\SQLEXPRESS;Initial Catalog=ASPMass;Integrated Security=True" providerName="System.Data.SqlClient"/>-->
        <add name="ConnStr" connectionString="Data Source=GRAPHIX\SQLEXPRESS;Initial Catalog=GltzCartData;Integrated Security=True " providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>
        <siteMap>
            <providers>
                <add name="AdminSiteMap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Admin/Admin.sitemap"/>
            </providers>
        </siteMap>
        <!-- 
            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.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Xml.Linq, Version=3.5.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>
        -->
        <pages theme="Front_BlueTheme">
            <controls>
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            </controls>
        </pages>
        <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
        </httpHandlers>
        <httpModules>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter"/>
        </httpModules>
    </system.web>
    <system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="WarnAsError" value="false"/>
            </compiler>
        </compilers>
    </system.codedom>
    <!-- 
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
            <remove name="ScriptModule"/>
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/>
            <remove name="ScriptHandlerFactory"/>
            <remove name="ScriptHandlerFactoryAppServices"/>
            <remove name="ScriptResource"/>
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </handlers>
    </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

Where do I have to make changes to make my application run?

providerOption is not allowed as Child node in the compiler tag of the web.config.

<system.codedom>
    <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                    <providerOption name="CompilerVersion" value="v3.5"/>
                    <providerOption name="WarnAsError" value="false"/>
            </compiler>
    </compilers>
</system.codedom>

See here on the MSDN docmentation for the .NET 3.5 framework.

The error page pretty much tells you where the error lies and what is causing it.

I do not think that providerOption is a valid child element of the compiler element in version 2.0 of the framework. It is apparent from the information you have posted that your application is mapped to the version 2.0. If this is a problem, you should consider remapping the script map to v. 3.x.

AFAIK, this element is only available in .NET v3.x and above.

I just posted this issue and then, after I just bit the bullet, my solution . In a nutshell the 3.5 site needs the provider option element to be marked as three five, the server schema file for some reason doesn't have that as valid, place your own file next to it and it seems to be working.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM