MVC 4 website laden zeigt HTTP Fehler 500.19

Ich habe eine neue ASP.NET MVC 4-Anwendung, basierend auf Internet-Anwendung, die Vorlage konnte ich erfolgreich ausführen und die Authentifizierung einen Benutzer in VS 2012 Express.

Dann veröffentlicht es in einen Ordner im wwwroot, dann in IIS 7.5-manager erstellt ein virtuelles Verzeichnis auf den Ordner, und baute es zu einer Anwendung mit einer separaten 4.0, integriertem pool.

Als ich versuchte, durchsuchen Sie die Anwendung von innerhalb des IIS-MANAGERS erhalte ich den nächsten Fehler:

HTTP-Fehler 500.19 - Internal Server Error,
Die angeforderte Seite kann nicht zugegriffen werden, da die zugehörigen Konfigurationsdaten für die Seite ungültig sind.

Config-Fehler: kann Nicht hinzufügen doppelte Erhebung Eintrag vom Typ " add " mit eindeutigen Schlüssel-Attribut 'name' auf 'ExtensionlessUrlHandler-Integriert-4.0'

Config Quelle:

56:       <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
57:       <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />   
58:     </handlers>

gesucht hier,Ich fand die entsprechende Antwort:

Auflösung 1

Löschen Sie die fehlerhafte XML-element aus der ApplicationHost.config-Datei oder aus dem Internet.config-Datei.

Meine web.config-Datei ist wie folgt:

    <?xml version="1.0"?>
    <configuration>
      <configSections>
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
      </configSections>
      <connectionStrings>
        <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-digixMVC4-20120915233326;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-digixMVC4-20120915233326.mdf" providerName="System.Data.SqlClient"/>
      </connectionStrings>
      <appSettings>
        <add key="webpages:Version" value="2.0.0.0"/>
        <add key="webpages:Enabled" value="false"/>
        <add key="PreserveLoginUrl" value="true"/>
        <add key="ClientValidationEnabled" value="true"/>
        <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
      </appSettings>

      <!--
        The following attributes can be set on the <httpRuntime> tag.
          <system.Web>
            <httpRuntime targetFramework="4.5"/>
          </system.Web>
      -->
      <system.web>
        <compilation targetFramework="4.5"/>
        <httpRuntime/>
        <authentication mode="Forms">
          <forms loginUrl="~/Account/Login" timeout="2880"/>
        </authentication>
        <pages controlRenderingCompatibilityVersion="4.0">
          <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.Optimization"/>
            <add namespace="System.Web.Routing"/>
            <add namespace="System.Web.WebPages"/>
          </namespaces>
        </pages>
      </system.web>
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <handlers>
          <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
          <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
          <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
          <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/>
          <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
          <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />      
        </handlers>
      </system.webServer>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364g85"/>
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364g85"/>
            <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364g85"/>
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
      </entityFramework>
    </configuration>

So, ich bin ein schlecht-Entwickler MVC 4, möchte ich Fragen, ob jemand könnte herausfinden, die fehlerhafte xml-Elements in der Datei vor.

InformationsquelleAutor Sami-L | 2012-11-23

Schreibe einen Kommentar