I have an assembly whose purpose is basic logging.
I have other assemblies that reference this assembly.
Is there a way to share an object instance across the referencing assemblies? So, that for one logging activity just one instance of the logging class is used?
For example, if the method inside Logger assembly/namespace is called AddInfo()
. When Assembly A has a class that needs to log information it uses loggerInstance1.AddInfo()
... and when Assembly B needs to do the same...it re-uses the same loggerInstance1.AddInfo()
... and not loggerInstance2.AddInfo()