diff --git a/src/Microsoft.AspNetCore.Mvc.RazorPages/Infrastructure/PageDirectiveFeature.cs b/src/Microsoft.AspNetCore.Mvc.RazorPages/Infrastructure/PageDirectiveFeature.cs index 1d3e34e3a5..8a657ab010 100644 --- a/src/Microsoft.AspNetCore.Mvc.RazorPages/Infrastructure/PageDirectiveFeature.cs +++ b/src/Microsoft.AspNetCore.Mvc.RazorPages/Infrastructure/PageDirectiveFeature.cs @@ -56,7 +56,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure var codeDocument = RazorCodeDocument.Create(sourceDocument); PageDirectiveEngine.Process(codeDocument); - if (PageDirective.TryGetPageDirective(codeDocument.GetIRDocument(), out var pageDirective)) + if (PageDirective.TryGetPageDirective(codeDocument.GetDocumentIntermediateNode(), out var pageDirective)) { template = pageDirective.RouteTemplate; return true;