vendredi 14 septembre 2018

Create object which implements dynamically loaded interface type

Hi we are using log4net in our application. For some reasons, we have no reference to this DLL so we load the log4net DLL dynamically and access it with reflection API.

But now we want to collect Logs from several of our processes and show the Logs in realtime in a window, so I thought about using a RemotingAppender.

The Problem is, I have to implement RemotingAppender.IRemoteLoggingSink to create the Sink. But we only have access to the Type object of this interface.

Is there some way to dynamically generate a derived object from it via some kind of codedom/reflection similar as it is done by the testing framework Moq?





Aucun commentaire:

Enregistrer un commentaire