インターネットアプリケーションテンプレートに基づいて新しいASP.NET MVC 4アプリケーションを作成しましたが、VS20 Express内からユーザーを認証して正常に実行できました。MVC 4ウェブサイトの負荷がHTTPエラー500.19を示しています
次に、wwwrootのフォルダに公開し、IIS 7.5マネージャでそのフォルダを指す仮想ディレクトリを作成し、別の4.0統合プールを使用してアプリケーションに変換しました。
私は次のエラーを取得IISマネージャ内からアプリケーションを閲覧しようとすると:
HTTPエラー500.19 - 内部サーバーエラー、 のページに関連する設定データがあるため、要求されたページにアクセスすることができません無効。
コンフィグエラー:ユニークキー属性 '名前' と '追加' に設定タイプの重複コレクションエントリを追加することはできません 'ExtensionlessUrlHandlerは、統合-4.0' を
コンフィグソース:
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>
分解能1
不正な形式のXML ELEを削除します。対応する答えを見つけましたApplicationHost.configファイルまたはWeb.configファイルから取得できます。
私のweb.configファイルは以下の通りです:
<?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>
私はMVC 4に難熟練開発者ですと、誰かが上記ファイルに不正な形式のXML要素を見つけることができれば、私が求めるだろう。
役立ちます1人の
希望、異なる接尾_32bitまたは_64bitがあります。このポストフィックスはどういうわけか魔法ですか? – qub1n
私にとっても問題が発生します。私も_32bit/_64bitの接尾辞を持っていますが、どちらの方法でも文字列を変更すると、両方の文字列が変更されている限り問題は解決します。 2つは同じ正確なボディを持つことができますが、元の_32bit/_64bitの後置を保持することができます。それでも動作します。これは、マジックプレフィックスではないことを示しています。私は、それがソリューション内の/サーバー上の他のプロジェクトの間の一致をチェックしていると思われる。それは、または何か変わったIISで起こっている。 – 16807
これを読んだ後、それを見てみましょう:http://stackoverflow.com/questions/26271958/what-does-extensionlessurlhandler-do-in-an-mvc-applicationタグの追加/削除の順序は明らかに重要です。 IISが提供する既定の既定値を削除する前に、ExtensionlessUrlHandlersを追加していました。デフォルトは、私が追加したハンドラと同じ名前だったので、エラーです。 – 16807