Close

Error when enabling search plugin

BBlue
11 years ago
#3387 Quote
Avatar
  • 1
Hi,

I've recently downloaded the trial of Instant Search, however once it's installed and i go to the website i get the following error

Method not found: 'Void Nop.Web.Controllers.CatalogController..ctor(Nop.Services.Catalog.ICategoryService, Nop.Services.Catalog.IManufacturerService, Nop.Services.Catalog.IProductService, Nop.Services.Catalog.IProductTemplateService, Nop.Services.Catalog.ICategoryTemplateService, Nop.Services.Catalog.IManufacturerTemplateService, Nop.Services.Catalog.IProductAttributeService, Nop.Services.Catalog.IProductAttributeParser, Nop.Core.IWorkContext, Nop.Core.IStoreContext, Nop.Services.Tax.ITaxService, Nop.Services.Directory.ICurrencyService, Nop.Services.Media.IPictureService, Nop.Services.Localization.ILocalizationService, Nop.Services.Catalog.IPriceCalculationService, Nop.Services.Catalog.IPriceFormatter, Nop.Core.IWebHelper, Nop.Services.Catalog.ISpecificationAttributeService, Nop.Services.Helpers.IDateTimeHelper, Nop.Services.Orders.IShoppingCartService, Nop.Services.Catalog.IRecentlyViewedProductsService, Nop.Services.Catalog.ICompareProductsService, Nop.Services.Messages.IWorkflowMessageService, Nop.Services.Catalog.IProductTagService, Nop.Services.Orders.IOrderReportService, Nop.Services.Common.IGenericAttributeService, Nop.Services.Catalog.IBackInStockSubscriptionService, Nop.Services.Security.IAclService, Nop.Services.Stores.IStoreMappingService, Nop.Services.Security.IPermissionService, Nop.Services.Media.IDownloadService, Nop.Services.Logging.ICustomerActivityService, Nop.Services.Events.IEventPublisher, Nop.Core.Domain.Media.MediaSettings, Nop.Core.Domain.Catalog.CatalogSettings, Nop.Core.Domain.Orders.ShoppingCartSettings, Nop.Core.Domain.Localization.LocalizationSettings, Nop.Core.Domain.Customers.CustomerSettings, Nop.Web.Framework.UI.Captcha.CaptchaSettings, Nop.Core.Caching.ICacheManager)'.

Line 167:        public object ResolveOptional(Type serviceType)
Line 168:        {
Line 169:            return Scope().ResolveOptional(serviceType);
Line 170:        }

disabling the search or uninstalling it fixes the issue.

I've also installed the same companies Ribbon plugin and this works fine.

I've tried rebuilding the app and cleaning out the bin, but no change.

Any suggestions?
Boyko
11 years ago
#3392 Quote
Avatar
  • 1570
Hi BBlue,

We emailed you.

Thanks
Regards,
Nop-Templates.com Team
cicciuzzo
10 years ago
#4418 Quote
Avatar
  • 34
How solved you this problem?

BBlue wrote:
Hi,

I've recently downloaded the trial of Instant Search, however once it's installed and i go to the website i get the following error

Method not found: 'Void Nop.Web.Controllers.CatalogController..ctor(Nop.Services.Catalog.ICategoryService, Nop.Services.Catalog.IManufacturerService, Nop.Services.Catalog.IProductService, Nop.Services.Catalog.IProductTemplateService, Nop.Services.Catalog.ICategoryTemplateService, Nop.Services.Catalog.IManufacturerTemplateService, Nop.Services.Catalog.IProductAttributeService, Nop.Services.Catalog.IProductAttributeParser, Nop.Core.IWorkContext, Nop.Core.IStoreContext, Nop.Services.Tax.ITaxService, Nop.Services.Directory.ICurrencyService, Nop.Services.Media.IPictureService, Nop.Services.Localization.ILocalizationService, Nop.Services.Catalog.IPriceCalculationService, Nop.Services.Catalog.IPriceFormatter, Nop.Core.IWebHelper, Nop.Services.Catalog.ISpecificationAttributeService, Nop.Services.Helpers.IDateTimeHelper, Nop.Services.Orders.IShoppingCartService, Nop.Services.Catalog.IRecentlyViewedProductsService, Nop.Services.Catalog.ICompareProductsService, Nop.Services.Messages.IWorkflowMessageService, Nop.Services.Catalog.IProductTagService, Nop.Services.Orders.IOrderReportService, Nop.Services.Common.IGenericAttributeService, Nop.Services.Catalog.IBackInStockSubscriptionService, Nop.Services.Security.IAclService, Nop.Services.Stores.IStoreMappingService, Nop.Services.Security.IPermissionService, Nop.Services.Media.IDownloadService, Nop.Services.Logging.ICustomerActivityService, Nop.Services.Events.IEventPublisher, Nop.Core.Domain.Media.MediaSettings, Nop.Core.Domain.Catalog.CatalogSettings, Nop.Core.Domain.Orders.ShoppingCartSettings, Nop.Core.Domain.Localization.LocalizationSettings, Nop.Core.Domain.Customers.CustomerSettings, Nop.Web.Framework.UI.Captcha.CaptchaSettings, Nop.Core.Caching.ICacheManager)'.

Line 167:        public object ResolveOptional(Type serviceType)
Line 168:        {
Line 169:            return Scope().ResolveOptional(serviceType);
Line 170:        }

disabling the search or uninstalling it fixes the issue.

I've also installed the same companies Ribbon plugin and this works fine.

I've tried rebuilding the app and cleaning out the bin, but no change.

Any suggestions?
Boyko
10 years ago
#4428 Quote
Avatar
  • 1570
cicciuzzo wrote:
How solved you this problem?

Any suggestions?


Hi cicciuzzo,

This problem occurs if you have made modifications to the CatalogController constructor in nopCommerce. You shouldn't change the CatalogController constructor but rather resolve any new dependancies i.e services via the EngineContext.Current.Resolve method as described in this post.

Thanks
Regards,
Nop-Templates.com Team
cicciuzzo
10 years ago
#4430 Quote
Avatar
  • 34

and where should I put this code?
cicciuzzo
10 years ago
#4431 Quote
Avatar
  • 34
cicciuzzo wrote:

and where should I put this code?


I tried, but by obtaining this

Object reference not set to an instance of an object.
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:



Line 541:            return _cacheManager.Get(cacheKey, () =>
Line 542:            {
Line 543:                var model = _deliverySetService.GetProductDeliverySetsByProductId(product.Id, null, true)
Line 544:                   .Select(psa =>
Line 545:                   {
  

Source File:  e:\Dev\myweb\Presentation\Nop.Web\Controllers\CatalogController.cs    Line:  543

Boyko
10 years ago
#4439 Quote
Avatar
  • 1570
cicciuzzo wrote:

and where should I put this code?


Hi cicciuzzo,

You should put this code in the Catalog controller.
Instead of adding a new constructor parameter you need to create a private field and a property as described in the post that we linked in our previous post. Then you need to use the property directly as you would use as if you have set it via the constructor.
What are the new parameters that you have added in your Catalog controller?

Thanks
Regards,
Nop-Templates.com Team