RuSs
RuSs

Reputation: 1812

Exisiting Umbraco Umbraco v6.0.5 site throws No parameterless constructor defined for this object

I have an existing Umbraco v6.0.5 (Assembly version: 1.0.4869.18012) site which I built.

I got a new PC the other day and up until now, all my .NET projects have run fine on it.

I have loaded up the same code from the Umbraco site that is already working in production and on my old PC.

The site now throws: No parameterless constructor defined for this object when I hit a controller which inherits: RenderMvcController

Yes, this controller has no parameterless constructor as I use ninject to inject an interface into the following code:

public SignupController(ISignupManager signupManager)
{
    _signupManager = signupManager;
}

As I said, this code worked before and nothing has changed as I just did a fresh checkout of the working code from my SVN repo.

Any ideas would be great. Things to remember:

I am thinking that either I may be missing some thing that umbraco needs or my dependency injection is not firing.

Here is my stack trace:

at System.Web.Mvc.DefaultControllerFactory.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType)
at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter)
at System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues)
at ASP._Page_Views_Donate_cshtml.Execute() in d:\Projects\Biggest Game Of Cricket\trunk\Umbraco\Views\Donate.cshtml:line 9
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)

Thanks in advance for any help.

RuSs

Upvotes: 0

Views: 623

Answers (2)

RuSs
RuSs

Reputation: 1812

The problem was the Ninject.Web.MVC DLL was the wrong version on my local. just took me a whole day to find this. thansk @Digbyswift

Upvotes: 0

Digbyswift
Digbyswift

Reputation: 10410

If the code is exactly the same, then it will be a machine configuration issue. Do you have both MVC3 and MVC4 installed?

However, it does sound like something is not registering correctly. I know you say that this is a fresh/clean checkout but that doesn't necessarily mean that everything was checked-in that needed to be :)

I would check that the same bin folder contents exist between projects and also that your dependency registration code is present/correct in both projects. It sounds possible that your global.asax file isn't using the Ninject registration code or is using it incorrectly.

Whether that means that there is a DLL reference missing (e.g. MVC4) or whether the global.asax markup is inheriting from the from class.

Upvotes: 2

Related Questions