Posted on 20/07/2023 15:13:22
Hi Alexandru,
Dynamicweb does not throw the MissingMethodException. That one comes from .NET and is rethrown by DW. There is, however, an issue that might lead to this confusion.
The MethodAddin tries to run the method as specified, but if that fails (the case here), it will try to execute a static method with the same name. In other words, it tries to execute an instance method and if that fails, it assumes the method is static and tries again. If this also fails, the last exception is rethrown. This can lead to confusion as the MissingMethodException refers to the reflection invocation trying to find a static method with the given name but doesn't find it.
It is possible to see that this exception isn't the root cause of the issue, however, but it requires checking the logs in Dynamicweb. A log entry is made containing the message of the first exception as well as the last exception. Generally, it's a good idea to check the logs when something doesn't go as planned, as these messages might contain more information than an exception message does.
I'll make a task to get the logic around method invocation cleaned up, so the thrown exceptions are more indicative of the actual issue.
I hope that clears it up. otherwise let me know.
- Jeppe