问题
So if I have website project Foo which has a reference to class library project Bar, how do I remove that reference?
Thanks
David
回答1:
The reference is stored in the Visual Studio solution file.
Right-click on the web site's project item in Solution Explorer and choose "Property Pages". The first item on the dialog that comes up is "References". You can add/remove references from here.
Edit:
I should mention that this is in Visual Studio 2010. I don't have any other versions installed at the moment, so I can't verify that this works for them as well.
回答2:
Here's how I did it for Visual Studio 2017.
- Close the solution in Visual Studio
 - Open the solution file (
.sln) in a text editor - Locate the website project: 
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "YOUR-WEBSITE-NAME" - Locate the 
ProjectReferencesproperty under the project - The reference you want to delete might look like 
{03D389EB-38E0-4D71-86EF-E2ABCFB4AE21}|REFERENCE-TO-REMOVE.dll; - Delete it from within the string, including the semicolon
 
回答3:
There's a bug in all versions of Visual Studio 2005-2010 that make you think you are deleting a project reference, but when you try to add the reference back, it says it already exists. Solution: delete the solution file (SLN) and re-add all the projects back. This is the ONLY solution that works unless you can edit the solution file directly (which almost never works).
回答4:
In VS 2013, there is no direct option, you have to delete all dlls in bin/debug , and clean, re build solution, you are done.
回答5:
In Solution Explorer, Right-click on the project. In this view, go to References, and remove the offending reference.
回答6:
I had the same problem in 2008 but removing the reference didn't work, it just kept coming back. I ended up editing the solution file in notepad and removing the reference manually.
来源:https://stackoverflow.com/questions/3300189/how-do-i-remove-a-project-reference-from-a-website-project-in-visual-studio