I have an ASP.NET Core solution consisting of 4 projects: Domain for pure business rules, Application for app specific operations, Infrastructure for data access and Web for controllers, razor pages and other asp.net stuff. The dependency order between them is as follows:
Application >>> Domain
Infrastructure >>> Application
Web >>> Application
I'm using Autofac modules for DI. To register dependencies I have to reference the Infrastructure from Web project, which is something I don't feel good about it. Another idea to load the Infrastructure in the program is to introduce another project referencing all other projects solely to register the dependencies and bootstrap the app. Is the resistance to adding a reference to Infrastructure from Web an overkill? Or I should choose the second way and add another project to boot the app. If second How to add it. because the registration is inside the Startup class which belongs to Web project.