Visual Studio not building a dependency of a project

9.8k Views Asked by At

I have a project which consists of window services projects and a logic project for each one.

Let's say my windows service project is called Project1 and it has a logic project called Project1BL. If I build Project1, it builds Project1BL AND Project1 which is good.

My problem is with another project in this solution (Project2) if I build it and Project2BL is not built it throws an error

Metadata file Project2BL/bin/debug/Project2BL.dll not found

I don't want to have to build Project2BL explicitly each time I build the solution.

Anyone has an idea why would one project give me this issue while another project doesn't?

4

There are 4 best solutions below

0
On

Try opening your solution's properties, then select

Common Properties - Project Dependencies.

Select Project2 and check Project2BL as the dependency

0
On

It sounds like Project2BL is an assembly reference for Project2, and not a project reference. What you could try doing is removing the reference to Project2BL, then add it back as a project reference. So with Visual Studio 2010, in the Project2 project, you would expand the References folder, right-click Project2BL and choose "Remove". Then you would right-click the References folder, choose "Add Reference", then click the "Projects" tab, and choose Project2BL from the list and click "OK". This adds Project2BL as a project reference. What this means is that whenever you build Project2, the build process knows that it must first build the Project2BL project, and so you won't have to explicitly build it.

0
On

I evetually fixed it by simply removing the project "Project2BL" from the solution and readding it. It moved the decleration of the project in the .sln to the bottom and that solved it.

0
On

Although I have added the build dependency the dependency was still not showing. The reference was not added.

I fixed this through: Dependencies -> Add Reference -> Projects.