2sxc 博客出错:不包含 'LinkToPageNumber' 的定义

Error with 2sxc Blog: does not contain a definition for 'LinkToPageNumber'

我们有 2sxc AppBlog 模块,它已经运行了几个月。突然,客户联系我说它不起作用。加载页面时,错误为“Error rendering template”。在日志中,完整的异常是:

Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'ASP._Page_Portals_0_2sxc_Blog_App__library_cshtml' does not contain a definition for 'LinkToPageNumber'
at CallSite.Target(Closure , CallSite , Object , Int32 )
at ASP._Page_Portals_0_2sxc_Blog_App__pager_cshtml.Execute() in c:\Webs\TAD\Portals[=11=]sxc\Blog App\_pager.cshtml:line 18
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.WebPages.WebPageBase.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer)
at System.Web.WebPages.HelperResult.WriteTo(TextWriter writer)
at System.Web.WebPages.WebPageBase.Write(HelperResult result)
at ASP._Page_Portals_0_2sxc_Blog_App__1_Main_blog_view_cshtml.Execute() in c:\Webs\TAD\Portals[=11=]sxc\Blog App\_1 Main blog view.cshtml:line 23
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at ToSic.SexyContent.Engines.RazorEngine.Render(TextWriter writer) in C:\ProjectsSexyContent\Web\DesktopModules\ToSIC_SexyContentSexy Content Razor\RazorEngine.cs:line 65
at ToSic.SexyContent.Engines.RazorEngine.RenderTemplate() in C:\ProjectsSexyContent\Web\DesktopModules\ToSIC_SexyContentSexy Content Razor\RazorEngine.cs:line 75
at ToSic.SexyContent.Engines.EngineBase.Render() in C:\ProjectsSexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\Engines\EngineBase.cs:line 89
at ToSic.SexyContent.SxcInstance.Render() in C:\ProjectsSexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\SxcInstance.cs:line 200

有什么想法吗?

好吧,通过更多的挖掘,我能够自己解决这个问题。 _pager.cshtml 文件中的代码正在调用 lib.LinkToPageNumber。 lib 被引用到另一个 .cshtml 文件,但 LinkToPageNumber 是 _pager.cshtml 文件本身中的一个方法。我所要做的就是删除 LinkToPageNumber 的几个实例前面的 lib.,一切都很好。

只有当我们的博客超过 1 页时才会出现此错误,这就是它在此之前工作正常的原因。