I have this code in my controller: And web configuration has injection dependencies: When I run the application, the error occurs: Source error: generated during an ineffective exception The information about the origin and location of the current web request exception was found using the exception stack trace below. Stack trace: [MissingMethodException:. No parameterless manufacturer defined for this object] System System.RuntimeTypeHandle.CreateInstance (RuntimeType type, Boolean publicOnly, Boolean Nashech, Boolean and Canbach, RuntimeMhandle Initial and Citi, Boolean and BND Security Check) +0 / System Runtime type Create Instance Slow (Boolean Public Only, Boolean Skip Check, Boolean Filcap) +98 System Reintime type Createinstant Default Control (Boolean Publiconeili, Boolean skipVisibility Checks, Boolean skipCheckThis, Boolean fillCache) 241 System.Activator.CreateInstance (type type, Boolean nonpublic) +69 I need ASP.NET MVC 3 and Razor engine to call the parametrized constructor. You must implement the
public class IssueController: BaseController, IIssueController { #region Member IPublicationsManagementService Publishing Service; #Editional # Regional Producer Public Issuer Control (IPublicationsManagementService Publishing Service) {this.publicationService = publicationService; } #endregion public ActionResult IssueSearch () Return View (New IssueSearchViewModel () {magazine = new selectList (publicationService.GetAllProducts (), "Id", "name")}); }
System.Web.Mvc.DefaultControllerActivator.Create (RequestContext requestContext, Type controllerType ) 67 official reseller interface. Once you do this, you can use dependency injection anywhere within the MVC 3 application, even though the idea (though property injection only).
Comments
Post a Comment