【发布时间】:2021-01-17 22:51:33
【问题描述】:
我最近尝试将我的网站从 U7.15.6 升级到 U8。我刚刚使用 FileZilla 将 /bin /umbraco /config 复制到了我当前的网站
当我尝试回滚到 U7.15.6 时出现以下错误:
以下方法或属性之间的调用不明确:'Umbraco.Web.UmbracoHelper.Media(params int[])' 和 'Umbraco.Web.UmbracoHelper.Media(params string[])' 描述:未处理的异常在当前 Web 请求执行期间发生。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。
异常详细信息:Microsoft.CSharp.RuntimeBinder.RuntimeBinderException:以下方法或属性之间的调用不明确:“Umbraco.Web.UmbracoHelper.Media(params int[])”和“Umbraco.Web.UmbracoHelper.Media(参数字符串[])'
来源错误:
Line 20: var section_node = Umbraco.Content(1xxx);
Line 21: var Section_pagesToList = @Section_node.Children.Where("Visible");
Line 22: Section_pagesToList = Section_node.DescendantsOrSelf().Where("NodeTypeAlias == @0", "NewsPage");
所以我做了什么,我将第 21 行更改如下:
string[] Section_pagesToList = @Section_node.Children.Where("Visible");
但现在我在页面的其他部分出现另一个错误 - 我在其中显示本节的特色图片:
Line 81: <div class="col-xl-6 col-lg-6 col-md-4 MainNewsBox">
Line 82: <figure>
Line 83: @if (Section_pagesToList.Last().HasValue("articleImg"))
第83行的错误是:
Compiler Error Message: CS1929: 'string' does not contain a definition for 'HasValue' and the best extension method overload 'PublishedContentExtensions.HasValue(IPublishedContent, string)' requires a receiver of type 'IPublishedContent'
如何解决这个问题并恢复我的网站?
谢谢。
【问题讨论】:
标签: razor umbraco umbraco7 umbraco8