Try our conversational search powered by Generative AI!

No parameterless constructor defined for this object.


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?

Feb 19, 2014 12:47

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

Edited, Feb 19, 2014 13:15
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.