Sitecore - ControllerRendering complaining about C

2019-05-07 15:18发布

问题:

So I have created my Controller Rendering, that uses controller

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

like so:

But when I try to access the page, I get an error complaining about the Controller not being controller enough:

But if I inspect the dll with the Object Viewer, the controller in question indeed inherits from IController:

So, what is going on here? Why am I receiving this error?

EDIT: I suspect that perhaps the error message is merely a symptom, and Sitecore is somehow unable to access the controller in the DLL. What factors could cause this behavior, and how can I debug them?

回答1:

This link worked for me: http://jockstothecore.com/adventures-in-dependency-injection/

Basically fully qualified controller names bug out the system. I updated mine to use the class name (minus the "controller" word) and proper action and it solved my issue.



回答2:

I checked TwitterConnectorController and I don't see any connection between /ajax/sociallogin and TwitterConnectorController

Please search for sociallogin controller and check if is inherits from from SitecoreController



回答3:

When I turned current framework of project to

.NET Framework 4.6.1

previously scaffolding was also not working and it started to work.