asp.net : add *.html to httphandlers

Web.configの<system.web>に追加、
    <httpHandlers>
      <add verb="GET, HEAD, POST, DEBUG" path="*.html" type="System.Web.UI.PageHandlerFactory"/>
    </httpHandlers>

エラー

‘/PcSite’ アプリケーションでサーバー エラーが発生しました。


拡張 ‘.html’ に対して登録されたビルド プロバイダはありません。machine.config または web.config の <compilation><buildProviders> セクションでビルド プロバイダを 1 つ登録できます。値 ‘Web’ または ‘All’ を指定する BuildProviderAppliesToAttribute 属性が含めれていることを確認してください。

説明: 現在の Web 要求を実行中に、ハンドルされていない例外が発生しました。エラーに関する詳細および例外の発生場所については、スタック トレースを参照してください。
例外の詳細: System.Web.HttpException: 拡張 ‘.html’ に対して登録されたビルド プロバイダはありません。machine.config または web.config の <compilation><buildProviders> セクションでビルド プロバイダを 1 つ登録できます。値 ‘Web’ または ‘All’ を指定する BuildProviderAppliesToAttribute 属性が含めれていることを確認してください。
ソース エラー:

現在の Web 要求の実行中にハンドルされていない例外が生成されました。障害の原因および発生場所に関する情報については、下の例外スタック トレースを使って確認できます。

スタック トレース:

[HttpException (0x80004005): 拡張 '.html' に対して登録されたビルド プロバイダはありません。machine.config または web.config の <compilation><buildProviders> セクションでビルド プロバイダを 1 つ登録できます。値 'Web' または 'All' を指定する BuildProviderAppliesToAttribute 属性が含めれていることを確認してください。]
   System.Web.Compilation.CompilationUtil.GetBuildProviderTypeFromExtension(CompilationSection config, String extension, BuildProviderAppliesTo neededFor, Boolean failIfUnknown) +3050573
   System.Web.Compilation.BuildManager.CreateBuildProvider(VirtualPath virtualPath, BuildProviderAppliesTo neededFor, CompilationSection compConfig, ICollection referencedAssemblies, Boolean failIfUnknown) +49
   System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +224
   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +582
   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +93
   System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +111
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +54
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
   System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +139
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +161


バージョン情報: Microsoft .NET Framework バージョン:2.0.50727.1434; ASP.NET バージョン:2.0.50727.1434

Web.configを<system.web><compilation>に<buildProviders>を追加

      <buildProviders>
        <add extension=".html" type="System.Web.Compilation.PageBuildProvider" />
      </buildProviders>

カテゴリー: 未分類 パーマリンク

コメントを残す