c# - Sitecore - ControllerRendering 提示 Controller "not found or does not implement IController."

标签 c# asp.net-mvc sitecore

所以我创建了我的 Controller 渲染,它使用 Controller

Sitecore.Social.Twitter.Client.Mvc.Areas.Social.Controllers.TwitterConnectorController

像这样:

enter image description here

但是当我尝试访问该页面时,我收到一个错误,提示 Controller 不够 Controller :

enter image description here

但是如果我用对象查看器检查 dll,有问题的 Controller 确实继承自 IController:

enter image description here

那么,这里发生了什么?为什么我会收到此错误?

编辑:我怀疑错误消息可能只是一种症状,Sitecore 不知何故无法访问 DLL 中的 Controller 。哪些因素可能导致此行为,我该如何调试它们?

最佳答案

这个链接对我有用: http://jockstothecore.com/adventures-in-dependency-injection/

基本上,完全合格的 Controller 名称会使系统出错。我更新了我的以使用类名(减去“ Controller ”一词)和适当的操作,它解决了我的问题。

关于c# - Sitecore - ControllerRendering 提示 Controller "not found or does not implement IController.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36624936/

相关文章:

c# - 处理在 xaml 中创建的控件

css - MVC CSS 默认颜色

asp.net-mvc - 如何在自定义助手中合并 htmlAttributes

c# - 这些 javascript include 定义有区别吗

asp.net-mvc - “System.Web.Webpages.Html.Htmlhelper”不包含 'Sitecore' 的定义

sitecore - 实现 Sitecore Multisite Robots.txt 文件

c# - 如何将任何对象序列化为字符串?

c# - Azure 和 SignalR : System.Net.Sockets.SocketException:尝试以访问权限禁止的方式访问套接字

c# - 具有绑定(bind)属性的图像 IsEnabled 不起作用 Xamarin 表单

exception-handling - 为什么我应该在 Sitecore 中使用 Assert.IsNull?