How do I remove a project reference from a website project in Visual Studio?

荒凉一梦 提交于 2019-12-05 00:33:56

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.

Here's how I did it for Visual Studio 2017.

  1. Close the solution in Visual Studio
  2. Open the solution file (.sln) in a text editor
  3. Locate the website project: Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "YOUR-WEBSITE-NAME"
  4. Locate the ProjectReferences property under the project
  5. The reference you want to delete might look like {03D389EB-38E0-4D71-86EF-E2ABCFB4AE21}|REFERENCE-TO-REMOVE.dll;
  6. Delete it from within the string, including the semicolon

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

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.

In Solution Explorer, Right-click on the project. In this view, go to References, and remove the offending reference.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!