I have a .NET application (actually this can be a problem for any N-Tiered application) which has 3 separate components.
- Has Cross Cutting Concerns like logging, authentication and IoC resolving.
- Has static Utility classes for Encoding/Decoding, Encryption etc.
- Has external library references like YouTube, Azure, AWS nuget packages and libraries.
- References to ClassLibrary to use logging and static utility classes.
- Background Application
- Also references to Class Library.
- Includes logic to utilize ThirdParty Apps, such as consuming YoutubeAPI
My problem in here, from Background Application, I do not want do direct reference to ThirdPartyApps. Because, I want ClassLibrary to resolve provider I want (from ThirdPartyApps).
But I cannot register ThirdPartyApps in ClassLibrary with Autofac (IoC container), because ClassLibrary already referenced by ThirdPartyApps, so it will create "Circular Dependency Error".
Seems like I am missing an implementation logic here, and would like to see what would be a possible way to resolve it.
I am thinking to create another component for dependency mapping, but I do not want to create unnecessary extra component for no reason (or maybe this will be the solution?).
Is there any wrong logic I am missing here?