문제

We've recently adopted Sitefinity and have begun creating MVC widgets. Overall this has been working as advertised. Then, after having tested my new widget, I realized I named it wrong! I then changed my controller name from MyWidgletController to MyWidgetController. After making the change I began getting the exception "The controller with the name 'MySitefinityApp.Mvc.Controllers.MyWidgletController' cannot be resolved". Scratch my head. Build...again. Still same problem. Recycle App-Pool. Same problem.

Here is the controller I'm working with (Names have been changed to protect the identity of the widgets involved):

[ControllerToolboxItem(Name = "MyWidget", Title = "My Widget", SectionName = "My Custom Widget Section")]
public class MyWidgetController : Controller
{
    public ActionResult Index()
    {
        return View("Default");
    }
}

Question: Why is Sitefinity still looking for MyWidgletController when it no longer exists?

도움이 되었습니까?

해결책

It turns our that Sitefinity persists the name of the controller to its DB. If you run into this problem you can find your undead controller here:

select top 10 * from sf_control_properties where name = 'ControllerName'

Ugh. This is horrific. Sitefinity, you should be ashamed.

다른 팁

LOL, I have been the same situation where i created custom widget with mvc. another workaround is Goto >> /Sitefinity/Administration/Settings/Advanced

Then Below ToolBoxes>>PageControls>>Sections you will find out your Modules, then delete necessary dead widgets

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top