每个配置文件中的节只能出现一次。请参阅帮助主题< location>。例外。为什么? [英] Sections must only appear once per config file. See the help topic <location> for exceptions.Why?

查看:76
本文介绍了每个配置文件中的节只能出现一次。请参阅帮助主题< location>。例外。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


配置错误
描述:在处理服务于此请求所需的配置文件时发生错误。请查看下面的特定错误详细信息,并适当修改您的配置文件。

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.



<configuration>

  <system.net>
    <mailSettings>
      <smtp from="makovetskiyd@yahoo.co.uk">
        <network host="smtp.gmail.com" enableSsl="true" defaultCredentials="false" port="587" userName="****" password="****"/>
      </smtp>
    </mailSettings>
  </system.net>

  <connectionStrings>
    <clear/>
<add name="SqlState" connectionString="Data Source=localhost;DataBase=AnyNameOfServerState;Integrated Security=True" providerName="System.Data.SqlClient"/>
<add name="YourGuruDB" connectionString="Data Source=DIMA-00AA1DA557;Initial Catalog=model;Integrated Security=True"/>
<add name="modelConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename='D:\Documents and Settings\Dima\My Documents\Visual Studio 2010\WebSites\WebSite10\App_Data\ASPNETDB.MDF';Integrated Security=True;User Instance=True;Trusted_Connection=Yes;" providerName="System.Data.SqlClient"/>
  </connectionStrings>


  <system.web>

<sessionState mode="SQLServer" sqlConnectionString="SqlState" allowCustomSqlDatabase="true" cookieless="false" timeout="20"/>
<compilation debug="true"/>

<authentication mode="Forms">
  <forms name=".MyCookie" loginUrl="~/Registration.aspx" protection="All" timeout="30" path="/">
    <credentials passwordFormat="MD5">
      <user name="****" password="****"/>
    </credentials>
  </forms>
</authentication>

<authorization>
  <deny users="?"/>
  <allow users="*"/>
</authorization>

<roleManager enabled="true" defaultProvider="MyRoleProvider">
  <providers>
    <clear/>
    <add name="MyRoleProvider" applicationName="/" connectionStringName="modelConnectionString" type="System.Web.Security.SqlRoleProvider"/>
  </providers>
</roleManager>

<membership defaultProvider="MyMembershipProvider">
  <providers>
    <clear/>
    <add name="MyMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="modelConnectionString" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" enablePasswordReset="true" maxInvalidPasswordAttempts="1000" passwordAttemptWindow="4000" enablePasswordRetrieval="true" requiresUniqueEmail="false" passwordFormat="Encrypted" applicationName="/WebSite10"/>
  </providers>
</membership>

<machineKey validationKey="****" decryptionKey="****" validation="SHA1" decryption="AES"/>
<compilation debug="true" targetFramework="4.0">
  <assemblies>
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=****"/>
    <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=****"/>
    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=****"/>
    <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=****"/>
  </assemblies>
</compilation>


推荐答案

您有两个编译标签

<compilation debug="true"/> 

<compilation debug="true" targetFramework="4.0">   
    <assemblies>     
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>     
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>     
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>     
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>   
    </assemblies> 
</compilation> 

这篇关于每个配置文件中的节只能出现一次。请参阅帮助主题&lt; location&gt;。例外。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆