Dynamic detector deserialization does not handle constructor arguments
In watch tasks, the detectors are supposed to be dynamically created, where the concrete detector class is decided by the name given in the WatchTaskArguments
/ DetectorConfiguration
.
The deserialization happens in the DetectorConverter.InstantiateDetectorFromString
method. However, in line 115 the detector constructor is always called without arguments.
All detectors (assuming that they all derive from the BaseDetector
class) are expecting an ILogger logger
argument. Some detectors, like the OpenWindowDetector
expect even more arguments.
In the current state, deserialization of detectors always fails, because no detector has a parameterless constructor.
Edited by Timo Pohl