views:

3855

answers:

7

I have a C# solution with a website project and a C# library. When compiling the solution, the website gives the message:

Could not get dependencies for project reference 'MyLibrary'.

This does not stop the wbsite compiling and running until I try and build it with a TFS build, when this error message fails the build.

What does this mean and how can I get round it?

+1  A: 

Open the Website proj file in notepad and check the reference etc... can help

abmv
+2  A: 

Look in your references. Make sure you have the correct path for the project reference for MyLibrary.

I would try to remove it and add it. Then instead of build I would choose Rebuild Solution, because rebuild deletes all .dll and rebuilds them.

David Basarab
+1  A: 

This is an official bug in the VS SDK:

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=276380

The bug is marked as won't fix.
g .
I don't think this bug is the root cause of the problem. We're not using the Managed Package Framework, as far as I can tell.
Damian Powell
+2  A: 

After trying many things, I realized something. The error was never going away, no matter what I did to clear the builds and such. I closed and reopened the solution and it went away.

Jim Carnicelli
A: 

If you get this problem all the time even after cleaning and rebuilding the solution, then it means there is something wrong with any of the referenced projects. Check the Output window for any warnings during the compilation process. Remedy the warning and it could help you compile with success.

Mudasser
A: 

try to check on the configuration for the project. I've notoced that changing it to 'any cpu' works.

sylvia
A: 

If by "TFS build" you mean you are using a separate build server then you could try checking the build configuration that the build server is using.

For example, when you build on your local machine you may be targeting the debug configuration while the build server is using the release configuration.

Configuration Manager

In each build configuration you could ensure that the project "MyLibrary" is selected to build.

Daniel Ballinger