Katy
Katy

Reputation: 296

rebuilding solution fails but rebuilding projects one by one will succeed

I have a solution in visual studio 2010 that consists of several windows applications. I added dll reference of one of this projects(called "A") in another project(called "B"). I also added reference of Automapper.dll in project "B". problem is : when I only rebuild project "B" it will build successfully, but when I rebuild all the solution , it will failed because Automapper.dll and A.dll aren't found. Meanwhile every time that I build the solution I should remove Automapper.dll and A.dll from project "B" and adding them again, otherwise building project B will faild. I also clean the solution but it doesn't work still. I'm waiting for your advices. Thanks all...

Upvotes: 4

Views: 1744

Answers (1)

PashaPash
PashaPash

Reputation: 2056

Make sure that project A is selected to build in current solution configuration (Build/Configuration Manager). Also, please check that you added B -> A reference as a project reference, not as dll reference.

It seems that B (Rcts.Proxy.Security) reference to the Automapper is broken. Make sure that automapper dll is located in some external folder, not in bin/obj, before adding a reference. Or rebuild will erase automapper.dll from bin, causing build to fail. Try using Automapper nuget package to make sure reference is added correctly.

The first project that fails to build is Rcts.Proxy.Security. You should fix it's references first. It is missing a reference to RCTS.Proxy.SVCProxy (or have a non-project reference). It is clear that VS attempts to build Rcts.Proxy.Security before RCTS.Proxy.SVCProxy and fails on missing RCTS.Proxy.SVCProxy class.

Upvotes: 2

Related Questions