Наш текущий проект написан на ASP.NET MVC 1 с использованием mvc-turbines (и unity) для IOC / DI.
Когда я пытаюсь запустить приложение с 2008 года, все работает нормально, но с 2010 года япродолжайте получать ошибку «Без конструктора без параметров».
Почему?Оба ориентированы на одну и ту же платформу .Net.Решение VS 2010 продолжает использовать фабрику контроллеров по умолчанию.Любые предложения по отладке этого?
[MissingMethodException: No parameterless constructor defined for this object.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +80
[InvalidOperationException: An error occurred when trying to create a controller of type 'CommonProject.Web.Shared.Controllers.MyController'. Make sure that the controller has a parameterless public constructor.]
System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +190
System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +68
System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +118
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +46
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +57
System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
System.Web.Mvc.MvcHttpHandler.VerifyAndProcessRequest(IHttpHandler httpHandler, HttpContextBase httpContext) +61
System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContextBase httpContext) +111
System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContext httpContext) +40
System.Web.Routing.UrlRoutingHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +7
CommonProject.Web._Default.Page_Load(Object sender, EventArgs e) in