Search code examples
visual-studio-2010projectdependency-properties

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?


Solution

  • 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.