Asp.net mvc 5 确保控制器仅在活动服务器上(而不是本地)存在无参数公共构造函数错误

Asp.net mvc 5 确保控制器仅在活动服务器上(而不是本地)存在无参数公共构造函数错误,asp.net-mvc-5,Asp.net Mvc 5,我定期在我们的web服务器上收到以下错误 An error occurred when trying to create a controller of type... Make sure that the controller has a parameterless public constructor 无论我在本地运行多少代码,我都不会遇到这种情况。而且这种情况大多数情况下不会发生在实时web服务器上。那么,你知道为什么这只是偶尔发生吗?下面是一个违规控制器的示例 public class

我定期在我们的web服务器上收到以下错误

An error occurred when trying to create a controller of type... Make sure that the controller has a parameterless public constructor
无论我在本地运行多少代码,我都不会遇到这种情况。而且这种情况大多数情况下不会发生在实时web服务器上。那么,你知道为什么这只是偶尔发生吗?下面是一个违规控制器的示例

public class TimesheetExpenseDashboardController : AdminControllerBase
{
    private readonly ITimesheetController _timesheetController;
    private readonly IExpenseController _expController;

    public TimesheetExpenseDashboardController(ITimesheetController timesheetController, IExpenseController expController) : base(Enums.Tabs.Time)
    {
        _timesheetController = timesheetController;
        _expController = expController;
    }
}


public class AdminControllerBase : Controller
{
    public AdminControllerBase(Enums.Tabs tab)
    {
        if (!AdminSecurity.ValidatedUser())
        {
            AdminSecurity.Redirect();
            Response?.End();
        }
        ViewData[Enums.ViewDataKeys.ActiveTab.ToString()] = tab;
    }

    protected void ResetTabType(Enums.TecwareTab tab)
    {
        ViewData[Enums.ViewDataKeys.ActiveTab.ToString()] = tab;
    }
}