& lt;身份验证模式=“forms"祝辞Godaddy Hosting的配置错误

本文关键字:Godaddy 祝辞 Hosting 错误 配置 quot forms lt 身份验证 模式 | 更新日期: 2023-09-27 18:15:01

我在Godaddy Hosting中部署了一个web应用程序,并创建了一个虚拟目录。但是当我尝试通过URL访问应用程序时,我得到以下错误


'/'应用程序中出现服务器错误。

配置错误

描述:在处理一个服务此请求所需的配置文件。请参阅下面是具体的错误细节,并修改您的配置文件适当。

解析器错误消息:使用注册为的section是错误的allowDefinition='MachineToApplication'超出应用程序级别。这错误可能是由于虚拟目录未配置为

源错误:

</assemblies>
</compilation><authentication mode="Forms"><forms loginUrl="~/Account/LogOn" timeout="2880" />

</authentication>

我试着谷歌一下,几乎大多数的答案都与虚拟目录有关。我已经把我的网粘上了。在这里配置。

我也检查了主机支持,但他们说,这可能是编码错误。所以,如果我必须从其他角度思考,请告诉我。


<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=152368
  -->
`<configuration>`
   `<connectionStrings>
    <add name="ApplicationServices" connectionString="data            source=.'SQLEXPRESS;Integrated     Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"     providerName="System.Data.SqlClient" />
    <add name="fbpmProjectDetailsEntities"        connectionString="metadata=res://*/Models.ProjectDetail.csdl|res://*/Models.ProjectDetail.ss    dl|res://*/Models.ProjectDetail.msl;provider=System.Data.SqlClient;provider connection     string=&quot;data source=.'SQLEXPRESS;attachdbfilename=|DataDirectory|'fbpm.mdf;integrated     security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework&quot;"     providerName="System.Data.EntityClient" />
    <add name="fbpmUserEntities"      connectionString="metadata=res://*/Models.UserModel.csdl|res://*/Models.UserModel.ssdl|res:/    /*/Models.UserModel.msl;provider=System.Data.SqlClient;provider connection      string=&quot;data source=.'SQLEXPRESS;attachdbfilename=|DataDirectory|'fbpm.mdf;integrated     security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework&quot;"     providerName="System.Data.EntityClient" />
    <add name="fbpmUserPaySchedEntities"      connectionString="metadata=res://*/Models.UserPaymentSchedule.csdl|res://*/Models.UserPaymentSchedule.ssdl|res://*/Models.UserPaymentSchedule.msl;provider=System.Data.SqlClient;provide    r connection string=&quot;data     source=.'SQLEXPRESS;attachdbfilename=|DataDirectory|'fbpm.mdf;integrated security=True;user     instance=True;multipleactiveresultsets=True;App=EntityFramework&quot;"     providerName="System.Data.EntityClient" />
  </connectionStrings>
  <appSettings>
    <add key="webpages:Version" value="1.0.0.0" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral,     PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral,   PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral,  PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </assemblies>
    </compilation>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/LogOn" timeout="2880" />
    </authentication>
    <membership>
  <providers>
    <clear />
    <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" maxInvalidPasswordAttempts="3" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" applicationName="/" />
  </providers>
</membership>
<profile>
  <providers>
    <clear />
    <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
  </providers>
</profile>
<roleManager enabled="true">
  <providers>
    <clear />
    <add connectionStringName="ApplicationServices" applicationName="/"
      name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
    <add applicationName="/" name="AspNetWindowsTokenRoleProvider"
      type="System.Web.Security.WindowsTokenRoleProvider" />
  </providers>
</roleManager>
<pages>
  <namespaces>
    <add namespace="System.Web.Helpers" />
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Routing" />
    <add namespace="System.Web.WebPages" />
  </namespaces>
</pages>
<customErrors mode="Off"/>
  </system.web>
  <system.webServer>
      <modules runAllManagedModulesForAllRequests="false">
          <remove name="FormsAuthenticationModule" />
          <add name="FormsAuthenticationModule"     type="System.Web.Security.FormsAuthenticationModule" />
          <remove name="UrlAuthorization" />
          <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule"     />
      </modules>
    <validation validateIntegratedModeConfiguration="false" />
   <!--<modules runAllManagedModulesForAllRequests="true" />-->
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
     </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>`

请帮我找出问题。

谢谢,生梯

& lt;身份验证模式=“forms"祝辞Godaddy Hosting的配置错误

我猜真正的问题是身份验证之前的元素,也就是编译。这表明targetFramework属性实际上可能是罪魁祸首,这本身就表明您可能没有将IIS应用程序池配置为使用。net v4,而是使用v2.0

确保IIS可以访问您的文件所在的目录,当IIS可以访问该文件夹时发生此错误。只需更改权限,让IUSR和IIS_IUSR访问文件夹