存在しない「.ASPX」ファイルを参照するレイアウト アイテムを使用するように構成されたコンテンツ アイテムにアクセスすると、次のエラーが発生する場合があります。
ERROR Application error.
Exception: System.Web.HttpException
Message: The file '/layouts/MyLayout.aspx' does not exist.
Source: System.Web
at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
アイテムで使用されるレイアウト アイテムが有効な「.ASPX」ファイルを参照していることを確認してください。
アプリケーション エラーを表示する代わりに、ユーザーを「Layout not found」ページにリダイレクトさせたい場合は、次の手順を実行してください。
- 添付の「Sitecore.Support.389964.dll」を「bin」フォルダーに配置します。
- 次のプロセッサを「httpRequestBegin」パイプラインにある「LayoutResolver」プロセッサの後に追加します。
<httpRequestBegin>
...
<processor type=”Sitecore.Pipelines.HttpRequest.LayoutResolver, Sitecore.Kernel”/>
<processor type="Sitecore.Support.Pipelines.HttpRequest.LayoutFileResolver, Sitecore.Support.389964"/>