asp.net-mvc-3sitefinity-5

Ghost of Dead Sitefinity MVC Widget Controller Haunts Me


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?


Solution

  • 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.