Method not found: 'System.Collections.Generic.IList`1 <Nop.Core.Domain.Orders.BestsellersReportLine>

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 anni tempo fa
Hi

I hope someone can point me in the right direction as to what the problem may be with the following server error.

A little background, I am playing around with developing a plugin.

Nop Version 3.00

The plugin builds fine in VS2012 the solution builds fine as well no errors at all, and the plugin runs fine it does everything that is expected, with no errors or exceptions.

I build the solution and run the deploy.bat which runs fine no error or exceptions, I then get the plugin from the deployable folder and place it in the plugin folder of my test nop commerce website, running on a separate development server from the machine that I use to develop code,

The plugin installs fine no error or exception.

Now to the problem, when I run the the site and try and view the page the plugin widget zone is on I get the following exception

Server Error in '/' Application.

Method not found: 'System.Collections.Generic.IList`1<Nop.Core.Domain.Orders.BestsellersReportLine> Nop.Services.Orders.IOrderReportService.BestSellersReport(Int32, Int32, System.Nullable`1<System.DateTime>, System.Nullable`1<System.DateTime>, System.Nullable`1<Nop.Core.Domain.Orders.OrderStatus>, System.Nullable`1<Nop.Core.Domain.Payments.PaymentStatus>, System.Nullable`1<Nop.Core.Domain.Shipping.ShippingStatus>, Int32, Int32, Int32, Int32, Boolean)'.

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.MissingMethodException: Method not found: 'System.Collections.Generic.IList`1<Nop.Core.Domain.Orders.BestsellersReportLine> Nop.Services.Orders.IOrderReportService.BestSellersReport(Int32, Int32, System.Nullable`1<System.DateTime>, System.Nullable`1<System.DateTime>, System.Nullable`1<Nop.Core.Domain.Orders.OrderStatus>, System.Nullable`1<Nop.Core.Domain.Payments.PaymentStatus>, System.Nullable`1<Nop.Core.Domain.Shipping.ShippingStatus>, Int32, Int32, Int32, Int32, Boolean)'.




I am trying to display the Bestseller products in my plugin and I have used the following piece of code in my plugin


              if (_catalogSettings.ShowBestsellersOnHomepage && _catalogSettings.NumberOfBestsellersOnHomepage > 0)
                        {
                                                                      
                            //load and cache report
                            var report = _cacheManager.Get(string.Format(ModelCacheEventConsumer.HOMEPAGE_BESTSELLERS_IDS_KEY, _storeContext.CurrentStore.Id),
                                () =>
                                    //group by products (not product variants)
                                    _orderReportService.BestSellersReport(storeId: _storeContext.CurrentStore.Id,
                                    recordsToReturn: _catalogSettings.NumberOfBestsellersOnHomepage,
                                    groupBy: 2));
                            

                            //load products
                            products = _productService.GetProductsByIds(report.Select(x => x.EntityId).ToArray());
                            //ACL and store mapping
                            products = products.Where(p => _aclService.Authorize(p) && _storeMappingService.Authorize(p)).ToList();

                        }



As I say this plugin compiles and runs fine in VS2012 but I get the above exception when I try and run it on a website


Thanks
10 anni tempo fa
It appears that you plugin is not properly taken up by nopCommerce? Have you recycled app pool, and done 'reload plugin list'? :)
10 anni tempo fa
wooncherk wrote:
It appears that you plugin is not properly taken up by nopCommerce? Have you recycled app pool, and done 'reload plugin list'? :)


Hi

Thanks for the help but it did not fix it.

I Stopped the app pool, restarted it , then recycled it, logged in to Nop admin Relisted the Plugins, Restarted the Application, cleared the cache, but it has not fixed it :o(
4 anni tempo fa
Hi

Did you get the solution?
I am facing the same issue.
I have only added new property in order class.
but displaying the below error.

Method not found: 'Nop.Core.IPagedList`1<Nop.Core.Domain.Orders.Order> Nop.Services.Orders.IOrderService.SearchOrders(Int32, Int32, Int32, Int32, Int32, Int32, Int32, System.String, System.Nullable`1<System.DateTime>, System.Nullable`1<System.DateTime>, System.Collections.Generic.List`1<Int32>, System.Collections.Generic.List`1<Int32>, System.Collections.Generic.List`1<Int32>, System.String, System.String, System.String, System.String, Int32, Int32)'.

I have added new parameter in SearchOrders method but it is optional - default false


  var lastOrder = _orderService.SearchOrders(storeId: _storeContext.CurrentStore.Id,
                customerId: _workContext.CurrentCustomer.Id, pageSize: 1)
                .FirstOrDefault();

It works fine in local environment.
when uploading the code - it works.but after some time - it starts showing above error

My nop-commerce version is 3.90.

Thanks in advance
2 anni tempo fa
Hello,

Whenever we are getting below this kind of error in our plugin..

MissingMethodException: Method not found: 'System.Linq.IOrderedQueryable`1<Nop.Core.Domain.Catalog.Product> Nop.Services.Catalog.ProductExtensions.OrderBy(System.Linq.IQueryable`1<Nop.Core.Domain.Catalog.Product>, Nop.Core.Domain.Catalog.ProductSortingEnum)'.



and you are not getting this type of error in your local site
and facing on deploy site then

Please check that
have you deploy on a same version which you have created on......

for example
created plugin on 4.40.4
so pls we have to check that plugin deploy on same version

i hope this would be solution for this type of issue..

Suggesions are most welcome
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.