Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

No parameterless constructor defined for this object.

Vote:
 

Hello and thank you!

I've just started up a new EPiServer project and I got stuck when I'm in the controller (mvc) creating a constructor that looks like this:

public StartPageController(ContentLocator contentLocator, IContentLoader contentLoader)
{
this._contentLoader = contentLoader;
this.contentLocator = contentLocator;

}

I have two variables for these that is private readonly in the class...However..

If I create a parameterless constructor under the contentLocator constructor it works but my values get null ofcourse ._.

Any ideas?

#81559
Feb 19, 2014 12:47
Vote:
 

The easiest way to get your dependency injection to work would probably to copy the StructureMapDependencyResolver and DependencyResolverInitialization class in the Alloy templates.

#81560
Edited, Feb 19, 2014 13:15
Vote:
 
#81562
Edited, Feb 19, 2014 13:22
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.