Inhalte aufrufen

Profilbild

Create New Service Occur Error


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
2 Antworten zu diesem Thema

#1 tkchung23

tkchung23

    Member

  • Members
  • PunktPunkt
  • 16 Beiträge

Geschrieben: 20 April 2019 - 14:59

Hi all , I am facing the issue which is I created a new Service class in Service solution and Controller class in Admin solution.  In the Controller class constructor as below:

		public NewController(   //this is Constructor Controller class
			IPermissionService permissionService, 
			IPictureService pictureService
			 ,INewImagePictureService newImagePictureService //The new service
			)
		{
			_permissionService = permissionService;
			_pictureService = pictureService;
			_newImagePictureService = newImagePictureService;
		} 

After run in the web, the error has been occurred:

  

 

None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'SmartStore.Admin.Controllers.NewController' can be invoked with the available services and parameters:

Cannot resolve parameter 'SmartStore.Services.Common.INewImagePictureService newImagePictureService' of constructor 'Void .ctor(SmartStore.Services.Security.IPermissionService, SmartStore.Services.Media.IPictureService, SmartStore.Services.Common.INewImagePictureService)'.

 

Anyone can help??

thanks


  • Stephennuh gefällt das

#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 21 April 2019 - 18:27

You have to register your interface through Autofac.


  • tkchung23 gefällt das

Marcus Gesing

Smartstore AG


#3 tkchung23

tkchung23

    Member

  • Members
  • PunktPunkt
  • 16 Beiträge

Geschrieben: 22 April 2019 - 10:08

You have to register your interface through Autofac.

 

Thanks so much!!!