我在商业服务器IIS6上托管我的网站 - 我正试图将其移动到他们的IIS7盒子之一。 (代码在IIS6上工作正常)我收到500.19错误说明web.config文件是错误的? (两台服务器上的文件相同)我将IIS7框设置为经典模式。托管公司没有帮助! - 当我查看我的配置文件时,我看到“XML Error:mismatched tag”,但为什么呢?它;最后一行</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>
答案 0 :(得分:1)
您的问题不是最后一行,您错过了connectionstrings元素上的结束标记。