Developer forum

Forum » Integration » Error when choosing overload in task

Error when choosing overload in task

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

In an attempt to solve this issue with orders being cached: https://doc.dynamicweb.com/forum?ThreadID=95919&PID=1605 I tried to set up a scheduled task that clears the cache. I set it up as follows:

When I run it, I get this:

System.Reflection.AmbiguousMatchException: Ambiguous match found.<br/>   at System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers)<br/>   at System.Type.GetMethod(String name)<br/>   at Dynamicweb.Scheduling.MethodAddIn.MethodAddIn.Run()<br/>   at Dynamicweb.Scheduling.AddInJob.Execute()

Looks like that's because there are overloads that have parameters. How do I specify a parameterless version?

Imar


Replies

 
Thiago Tedesco
Reply

Hi Imar, I am encountering the same exact issue as you when attempting to clear the stock service cache and same as you, I am looking for a way to force a parameterless execution.

The version of Dynamicweb.Ecommerce.dll in use in my case is 1.17.13.

 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

I don't think you can until this is fixed in the core platform.

You could work around it with a custom DLL though. Something along the lines of:

namespace MyCompany.Ecommerce
{
  public class CacheManager
  {
    public void ClearStockService()
    {
      Dynamicweb.Ecommerce.Services.StockService.ClearCache();
    }
  }
}

Then compile and add your DLL to the site and then choose your DLL, MyCompany.Ecommerce, CacheManager and ClearStockService as the settings for the task.

Hope this helps,

Imar 

 

Votes for this answer: 1
 
Thiago Tedesco
Reply

Thank you, Imar!

That helps! We are going to try that.

Cheers,

Thiago

 

You must be logged in to post in the forum