开发者

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

So, if I have website pr开发者_运维技巧oject Foo which has a reference to class library project Bar, how do I remove that reference?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜