Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Multi Project Solution Issue

I have this solution in VS 2017 which has multiple projects:

  • Example.DomainModels
  • Example.DataAccess
  • Example.Infrastructure
  • Example.Web

So well, my Web project references Infrastructure and the Infrastructure project references DataAccess as well as DomainModels projects. The solution is working fine.

However, if inside my Web project, if I try to access any of the entities from the DomainModels, I can easily access that without any errors, even though Web project doesn't have any reference to the DomainModels.

Can you please help me understand how this referencing of the project works? Is it because the web project has indirect reference to the DomainModels (Web -> Infrastructure -> DomainModels)?

Thanks.

like image 407
Aneeq Avatar asked Jul 18 '26 07:07

Aneeq


1 Answers

Indeed , as per your comments web will have reference to all other projects

When you compile , The Infrastructure will be having references dataaccess and domain model namespaces attached to it hence you are able to access the types or namespaces present in dataaccess and domain models from web since you are refering Infrastructure from web .

like image 78
karthik kasubha Avatar answered Jul 20 '26 19:07

karthik kasubha