0

我将我的网站托管在商业服务器 IIS6 上 - 我正试图将其移动到他们的 IIS7 盒子之一。(代码在 IIS6 上运行良好)我收到 500.19 错误,说明 web.config 文件是错误吗?(两台服务器上的相同文件)我将 IIS7 框设置为经典模式。托管公司是没有帮助的!- 当我查看我的配置文件时,我确实看到了“XML 错误:标签不匹配”,但为什么呢?it;s 最后一行</configuration>并匹配第二行<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

这是我的 web.config 文件:

<?xml version="1.0"?>

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<appSettings>
<add key="DefaultConnectionString" value="AccessMembershipProvider" />
<add key="EmailFrom" value="webmaster@domain.com"/>
<add key="EmailTo" value="xyz@hotmail.com"/>
<add key="BlindEmail" value="xyz@hotmail.com"/>
<add key="TechTrainingConn" value="Provider=Microsoft.Jet.OleDb.4.0; Data Source=e:\App_Data\Tech_Training.mdb"/>
<add key="TechTraining" value="~/App_Data/Training.mdb" />
</appSettings>

<connectionStrings>
<add name="OdbcServices" connectionString="Driver={Microsoft Access Driver (*.mdb)};Dbq=e:\App_Data\Training.mdb;" />
<add name="OBDCConnectionString" connectionString="Dsn=MS Access Database;dbq=e:\App_Data\Tech_Training.mdb;defaultdir=e:\App_Data;driverid=25;fil=MS Access;maxbuffersize=2048;pagetimeout=5;uid=admin"
  providerName="System.Data.Odbc" />
 <add name="TTSite" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\App_Data\Tech_Training.mdb;User Id=admin;Password=;" providerName="System.Data.OleDb" />
<add name="accessConnectionString" connectionString="~/App_Data/Tech_Training.mdb" />
<system.net>
<mailSettings>
  <smtp deliveryMethod="network" from="webmaster@domain.com">
    <network
      host="localhost"
      port="25"
      defaultCredentials="true"
    />
  </smtp>
</mailSettings>
</system.net>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
<authentication mode="Forms" />
<membership defaultProvider="AccessMembershipProvider" 
            userIsOnlineTimeWindow="20">
  <providers>
    <add name="AccessMembershipProvider"
          type="AccessMembershipProvider"
          enablePasswordReset="true" 
          enablePasswordRetrieval="true"
          requiresQuestionAndAnswer="true"
          connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\App_Data\Tech_Training.mdb;Persist Security Info=False"
    />
  </providers>

</membership>

<roleManager defaultProvider="OdbcRoleProvider"
              enabled="true"
              cacheRolesInCookie="true"
              cookieName=".ASPROLES"
              cookieTimeout="30"
              cookiePath="/"
              cookieRequireSSL="false"
              cookieSlidingExpiration="true"
              cookieProtection="All" >

  <providers>
    <clear />
    <add name="OdbcRoleProvider"
        type="Samples.AspNet.Roles.OdbcRoleProvider"
        connectionStringName="OdbcServices"
        applicationName="SampleApplication"
        writeExceptionsToEventLog="false" />
  </providers>

</roleManager>

</system.web>

<location path="XYZ">
  <system.web>
    <authorization>
      <allow roles="Admin" />
      <allow roles="Chiefs" />
      <deny users="*" />
    </authorization>
  </system.web> 
</location>

</configuration>
4

1 回答 1

1

您的问题不是最后一行,您缺少 connectionstrings 元素上的结束标记。

于 2013-10-26T12:59:39.073 回答