Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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.

When you get the error message "Could not get dependencies for project reference", one of the possible causes could be that you are referencing another project in your solution which has a Target framework not compatible with the target framework of the referencing project.

You can see the target framework specified for a project by going to the project properties and selecting the Application tab on the left.

I'm writing this because it happened to me, I was referencing a project with Target framework 4.0 from a project with target framework 3.5.

In my case the referenced project was created on VS 2010 while the referencee was a VS 2008 solution. In this case just edited the vs 2010 project with notepad, and changed the ToolsVersion="4.0" to ToolsVersion="3.5"

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.

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.

This is an official bug in the VS SDK:

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

I opend this one, and I could read the following there: Von Microsoft am09.05.2007 um 19:05 bereitgestellt

Thanks for your feedback. We have reproduced this bug on Visual Studio 2005 SP1, and we are sending this bug to the appropriate group within the VisualStudio Product Team for triage and resolution.

Thank you, Visual Studio Product Team.

I think this bug still exists for web site projects and yes; we use VS 20102 Ultimate. I have an application in \APP_CODE under my Virtual Directory and I have 2 DLL of which the source code is C#, and I have 3 DLL?s of which the source code is Oxygene, OXygene (PASCAL) from RemObjects. I see this reference only with the DLL's written in PASCAL; but when I test this 3 DLL's from a test application all is fine and my test application has absolute no problem to reference any classes or vars inside this 3 DLL's. So what could be the difference in compilation/build ledaing to the following error string in the VS output window. An erro which as described many times, never goes away.

Could not get dependencies for project reference 'Toolbox'Could not get dependencies for project reference 'IMPLEM'Could not get dependencies for project reference 'LEGACY'Validating Web Site

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.

"Clean Solution" cant help, sometimes you need to remove DLL manually from website project (Bin folder). Remove DLL and build the Solution again.

Try to check on the configuration for the project. I've noticed that changing it to 'any CPU' works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top