Error while removing project dependency in VS2010
31,117
Solution 1
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.
Solution 2
I faced the same issue. But i could solve it by following
- Right click project, select Properties.
- Select Framework and References under Common Properties
- Select the references thats not needed.
- Click on Remove Reference.
Solution 3
Or =>
To remove a reference in Visual C#:
- In Solution Explorer, open the References node under the project node.
- Right-click a reference and click Remove
To remove a reference in Visual Basic:
- In Solution Explorer, right-click the My Project node for the project and select Properties.
- Click the References tab.
- In the References list, select the reference you want to remove.
- Click the Remove button
Solution 4
For Visual Studio 2013: On C++ projects (hope the same for others too)
- From the Solution Explorer, select the project and right click to select the properties
- In the properties window, on left pane, select Common properties => References
- Right side of the window, you have the option to Add or Remove the other dependency items.
- Then select OK, to save
Solution 5
If your project only has the .sln file but not any .csproj, you may want to
- check the ProjectReferences property and remove the reference project there
- remove the section from Project to EndProject
- also remove the related rows under GlobalSection(ProjectConfigurationPlatforms)
Related videos on Youtube
Author by
Aneesh Narayanan
Updated on July 09, 2022Comments
-
Aneesh Narayanan almost 2 years
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?
-
jw_ over 4 yearsVS2017+C++: In Solution Explorer, remove the dependencies under the References node under the project. And you also need to edit the sln file, and remove the ProjectSection(ProjectDependencies) = postProject section. And sometimes VS will restore the sln file, so if it doesn't work, you can check the sln file again and remove them.
-
-
onaclov2000 about 10 yearsI have tried this and was getting the error that is listed in the original write-up, just a note.
-
echawkes almost 6 yearsThis also worked for me with a .vcxproj file in Visual Studio 2015.