How to implement dependency injection in Startup.cs when dependencies are circular?
The best answer is probably to extract your service stuff into a separate project, or at least the service contracts (IMyService
). That should let both of your existing projects reference the service contracts without any conflicts. If you want to add other interfaces or add more implementations of the same interface, this will now be easy too.
An additional benefit may be a better overall architecture: Keeping contracts in a separate project without any actual logic (only interfaces) will generally result in better organized and cleaner code.