Close

Custom Rules

IvanSlater
9 years ago
#8618 Quote
Avatar
  • 89
Hi Iliyan!

The Autofac and Autofac.Integration.Mvc references were added to project, but the same error still occurs.

iliyan.tanev
9 years ago
#8622 Quote
Avatar
  • 347
Hi,

iliyan.tanev wrote:

The problem is from the Autofac and it happens when you try to resolve the registered dependency. According to the issue discussion I send you the problem happens due to the disposal of the scope on EndRequest. Maybe it has something to do with the resolution of the registered dependencies. Do you use them in some caching function ?
Regards,
Iliyan Tanev
Nop-Templates Dev Team
IvanSlater
9 years ago
#8624 Quote
Avatar
  • 89
No, Im not!

My code is that simple (see reply above).

The exception is thrown at nop's endrequest method.
iliyan.tanev
9 years ago
#8625 Quote
Avatar
  • 347
Try to use InstancePerLifetimeScope instead of InstancePerHttpRequest in your Dependency Register. Maybe this will fix the issue, because the LifetimeScope should live longer than the HttpRequest Scope, which means that the registered dependencies should be disposed rarely.
Regards,
Iliyan Tanev
Nop-Templates Dev Team
IvanSlater
9 years ago
#8626 Quote
Avatar
  • 89
Same error.

Can you send me an example of your reminder plugin?
iliyan.tanev
9 years ago
#8627 Quote
Avatar
  • 347
Could you submit a ticket with archive of your code so we could take a look at it ? 
Regards,
Iliyan Tanev
Nop-Templates Dev Team
IvanSlater
9 years ago
#8628 Quote
Avatar
  • 89
Done.

Ticket 971.

Thanks!
IvanSlater
9 years ago
#8644 Quote
Avatar
  • 89
Found!!!!

It is a Nop bug, fixed in 3.5 version. 

I found this code in ScheduleTaskController.cs:


                //do not dispose. otherwise, we can get exception that DbContext is disposed
                task.Execute(true, false);


But I cant find the respective changeset in nop's codeplex.
iliyan.tanev
9 years ago
#8649 Quote
Avatar
  • 347
Hi,

I am glad you have found the problem!

It was fixed in 3.40.
Regards,
Iliyan Tanev
Nop-Templates Dev Team
IvanSlater
9 years ago
#10083 Quote
Avatar
  • 89
I created a couple new rules and I need to make some customizations on your abandoned card rule. Is it possible to share your rule code with me? Can send it to my email ? I will be glad!

Nop 3.3 and 3.6 (if possible).

Thanks!