May 18 at 4:47 PM
Edited May 19 at 12:38 AM
The answer is that a 3rd party library can definitely use Enterprise Library.
You are right -- the most complicated scenarios would be if the consuming application was also using Enterprise Library. This isn't really specific to Enterprise Library but for all third party libraries. There are a variety of approaches that you could take
to mitigate these issues such as installing in the GAC (multiple versions can live side by side in the GAC),
specifying the codebase
, or a
custom assembly resolver
Of course, this all adds complication if you want to support all potential scenarios (sometimes it's hard to know how people will use your library!).
If your library is exposing the logging functionality externally (and not just using it internally for errors or tracing) then you should consider how that is done since you are imposing requirements (and dependencies) on your users. You may consider letting
users to bring their own logger but that implies knowing how to use all supported loggers (plus there could be other potential issues -- what if a user disposes of the logger you are using?).
There is a project, Common.Logging
, which provides a common interface (as well as adapters) that supports Enterprise Library, log4net, and NLog. That might help you since it sounds very similar
to what you mention.
Enterprise Library support engineer