© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
116 replies
.tree

❔ Circular dependency between projects

I have 3 projects:

1.
Library
Library

2.
REST API
REST API

3.
Windows service
Windows service


The
service
service
is supposed to host the
API
API
.

Both the
API
API
and
service
service
depend on the
library
library
. The
service
service
depends on the
API
API
so it knows to run it.

Problem: The
API
API
also depends on the
service
service
, as there is one property
P
P
in
service.classA
service.classA
it uses, causing a circular dependency.
P
P
is an object
library.Interfaces.I
library.Interfaces.I
.

I'm unsure how to resolve this. Just putting
classA
classA
into the
library
library
doesn't work, as
classA
classA
also depends on a model
service.Models.M
service.Models.M
. I guess I could put
M
M
in the
library
library
too, but is that a good approach?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

❔ Circular dependency between projects
C#CC# / help
3y ago
Circular Dependency
C#CC# / help
2y ago
Circular Dependency
C#CC# / help
2y ago
Referencing between Two Projects
C#CC# / help
3y ago