我有一个在asp.net mvc 2中开发的网站。 我在公共域服务器上上传项目后出现此错误。(如Godaddy)
找不到方法:'System.String System.Web.Mvc.Html.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper,System.String,System.String,System.String)'。
简介是:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MissingMethodException: Method not found: 'System.String System.Web.Mvc.Html.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper, System.String, System.String, System.String)'.
Source Error:
Line 50:
< div class="nav_box" >
Line 51: < ul >
Line 52: < %= Html.MenuItem(Resources.Global.Home, "Index", "Home")%> //**Getting error here.**
Line 53: < %= Html.MenuItem(Resources.Global.Search, "Index", "Search")%>
Line 54: < %= Html.MenuItem(Resources.Global.Chemistry, "Chemistry", "Dating")%>
源文件:d:\ hostfolder \ 61231230 \ html \ test \ Views \ Shared \ NewGeneral.Master Line:52
Stack Trace:
[MissingMethodException: Method not found: 'System.String System.Web.Mvc.Html.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper, System.String, System.String, System.String)'.]
DatingScript.Helpers.MenuItemHelper.MenuItem(HtmlHelper helper, String linkText, String actionName, String controllerName) in MenuItemHelper.cs:34
ASP.views_shared_newgeneral_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\hostfolder\6954170\html\test\Views\Shared\NewGeneral.Master:52
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Control.Render(HtmlTextWriter writer) +10
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +59
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266
答案 0 :(得分:0)
检查包含上述命名空间的DLL的版本号,并验证您使用的是正确/预期的版本。
当我突然收到消息时,我今天经历了类似的事情:
“未找到方法:'System.String Sitecore.Web.WebUtil.GetSafeQueryString(System.String)'。”
尝试访问sitecore shell时。
当我在开发团队中开发时,我不得不对bin文件夹中的DLL进行一些分析,因为我的构建中没有构建错误,并且引用的命名空间放在Sitecore dll中。
当我将失败的Sitecore.Kernel.dll文件版本与工作解决方案中的Sitecore.Kernel.dll版本进行比较时,我发现版本号有所不同,并且Sitecore dll是从我未更新的存储库中复制的最近。