以下方法或属性之间的调用不明确:
我有2个网站; 一个是公共的,另一个是管理员。这些是独立的网站。 theSite.dll适用于public,而theSiteCMS适用于admin。
下面的代码来自AdminSite即theSiteCMS。该站点还包含theSite.dll引用,该引用也具有相同的成员函数Html.ActiveLinkImage。
我怀疑我无法隔离这些呼叫;因此错误。 请建议正确的方法。
代码theSiteCMS(管理站点)
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<theSiteCMS.Helpers.Pagination>"%> Articles Management function goToPage(pageIndex) { $("#page").val(pageIndex); $('#SearchForm').submit(); } function sortField(fld, sortDirection) { $("#sort_field").val(fld); $("#sort_dir").val(sortDirection); $('#SearchForm').submit(); return false; } Articles Management
Status Section Category User Keyword
Action Comments View count
,
previous | next
我得到的错误:
The call is ambiguous between the following methods or properties: 'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)' and 'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)' \My Documents\Visual Studio 2008\Projects\3ICMS\Views\Articles\Index.aspx 111 ------ The call is ambiguous between the following methods or properties: 'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)' 'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)' \My Documents\Visual Studio 2008\Projects\3ICMS\Views\Articles\Index.aspx 116 ------ The call is ambiguous between the following methods or properties: 'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)' and 'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)' \My Documents\Visual Studio 2008\Projects\3ICMS\Views\Articles\Index.aspx 106 ------ The call is ambiguous between the following methods or properties: 'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)' and 'System.Web.Mvc.Html.HtmlExtensions.ActionLinkImage(System.Web.Mvc.HtmlHelper, string, string, string, object, object)' \My Documents\Visual Studio 2008\Projects\3ICMS\Views\Articles\Index.aspx 101
看起来你有两个不同版本的System.Web.Mvc dll以某种方式引用它并且它不知道要调用哪个。
我的建议是从'theSiteCMS'
删除System.Web.MVC的任何引用(因为'theSite.dll'
已经包含它),然后添加theSiteDLL
作为项目 theSiteDLL
。
我认为它们都在同一个解决方案文件中。 我希望这有帮助。
- 在javascript中转换内联c#脚本中的双引号
- 有条件地禁用ASP.NET MVC控制器
- 使用await Task async挂起MVC应用程序中的控制器
- 没有为“Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory”类型提供服务
- 使用自定义消息的MVC 3 AuthorizeAttribute重定向
- 如何在ASP.NET MVC上执行Azure Active Directory单一登录和表单身份validation
- 无法在ASP.NET中更新cookie
- Asp.Net Web API中带字典参数的方法
- ASP.NET MVC + LINQexception