In my code I have the following interface
public interface ILogParser<TParserOptions> { }
I have retrieved all types that use this interface via reflection and I am trying to instantiate them. Normally I would do something along the lines of:
var parser = (ILogParser)Activator.CreateInstance(parserType)
However, this doesn't work when you are dealing with Generics, since you need to know the generic type at the time of casting, which can vary depending on each implemented type.
Is this possible?