Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while removing project dependency in VS2010

I have a large solution with number of projects. Some the projects depend on others (never a circular dependency though).

When I tried to remove a dependency of a project, I am getting an error message like "The dependency was added by the project system and cannot be removed". What is the cause for this error? How I can solve this?

like image 911
Aneesh Narayanan Avatar asked Oct 10 '12 11:10

Aneesh Narayanan


People also ask

How do I remove a project dependencies?

On the Project menu, choose Project Dependencies. The Project Dependencies dialog box opens. On the Dependencies tab, select a project from the Project drop-down menu. In the Depends on field, clear the check boxes beside any other projects that are no longer dependencies of this project.

How do I remove a project from solution?

In Solution Explorer, select the project item you want to remove. On the Edit menu, click Remove. On the confirmation dialog, click Remove to remove the item from the project.


1 Answers

I sometimes get this problem when I try to manually edit projects/solutions generated by our CMake system. I solve it manually:

  • Open the dependent .vcproj file in your favorite text editor.
  • Find <ProjectReference> tag corresponding to the dependency you want to remove (the include attribute of the tag will contain the name of the dependency project).
  • Remove the whole <ProjectReference> element (i.e. starting with <ProjectReference> and ending with </ProjectReference> inclusive). Save the file.
  • Reload the solution.
like image 180
malenkiy_scot Avatar answered Sep 20 '22 14:09

malenkiy_scot