The call is ambiguous beetween the following methods or properties MVC, devexpress

落花浮王杯 提交于 2019-12-10 17:05:29

问题


I have a MVC project and I'm using devexpres 14.1.6. I defined devexpress scripts and stylesheets on _Layout.cshtml page as below

head =>

 @Styles.Render("~/Content/css")
    @Styles.Render("~/Content/Bootstrap/css")
    @Scripts.Render("~/bundles/modernizr")

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)

    @Html.DevExpress().GetScripts(
    new Script { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
    new Script { ExtensionSuite = ExtensionSuite.HtmlEditor },
    new Script { ExtensionSuite = ExtensionSuite.GridView },
    new Script { ExtensionSuite = ExtensionSuite.PivotGrid },
    new Script { ExtensionSuite = ExtensionSuite.Editors },
    new Script { ExtensionSuite = ExtensionSuite.Chart },
    new Script { ExtensionSuite = ExtensionSuite.Report },
    new Script { ExtensionSuite = ExtensionSuite.Scheduler },
    new Script { ExtensionSuite = ExtensionSuite.TreeList }

body =>

    @Html.DevExpress().GetStyleSheets(
    new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
    new StyleSheet { ExtensionSuite = ExtensionSuite.Editors },
    new StyleSheet { ExtensionSuite = ExtensionSuite.HtmlEditor },
    new StyleSheet { ExtensionSuite = ExtensionSuite.GridView },
    new StyleSheet { ExtensionSuite = ExtensionSuite.PivotGrid },
    new StyleSheet { ExtensionSuite = ExtensionSuite.Chart },
    new StyleSheet { ExtensionSuite = ExtensionSuite.Report },
    new StyleSheet { ExtensionSuite = ExtensionSuite.Scheduler },
    new StyleSheet { ExtensionSuite = ExtensionSuite.TreeList }
)

While my devexpress version is 14.1.3 my project was working perfectly but after I upgrated my devexpress version 14.1.3 to 14.1.6 I started recieve the following error =>

CS0121: The call is ambiguous between the following methods or properties: 'DevExpress.Web.Mvc.UI.HtmlHelperExtension.DevExpress(System.Web.Mvc.HtmlHelper)' and 'DevExpress.Web.Mvc.UI.HtmlHelperExtension.DevExpress(System.Web.Mvc.HtmlHelper)'

I cleaned Temporary ASP.NET Files but I recieved same error.


回答1:


If you upgrade the DX version the old assemblies will not get removed from the bin directory.

Then the mentioned error will show up. Manually clean the directory ( VS does not know the old files anymore and probably will not delete them ).

Edit: This not only applies to DX assemblies but any assembly you might upgrade.



来源:https://stackoverflow.com/questions/25885984/the-call-is-ambiguous-beetween-the-following-methods-or-properties-mvc-devexpre

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!