Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove VS2010 references to deleted files in web project

I went behind VS2010's back and deleted some images from an image folder that's referenced by a web project as Content. In the solution navigator, these files now show up with the yellow warning icon that the file cannot be found. Refreshing the folder has no effect. Is there a way to tell VS2010 to automatically synch a folder? The VS Website project does this by default.

like image 985
ATL_DEV Avatar asked Feb 06 '12 20:02

ATL_DEV


People also ask

How do I remove source control from Visual Studio project?

In the Project Explorer, select the file to remove. If you select a folder, project, or solution, any eligible child items will also be removed. choose Source Control > Remove or press Ctrl+R, R.

How do you delete a file from a project?

If you select a file in the project tree and hit the Delete key or you right click on a file and select Delete from the popup menu, not only will your file be removed from your project, but it will also be deleted from your hard drive without any means of recovery.

How do I permanently delete a project in Visual Studio?

Navigate to your project under the Visual Studio Projects folder. Right-click the project and select Delete. A delete confirmation appears. Click OK.


2 Answers

In Visual Studio go to the missing files, select them and press del (or right click and select Delete).

Save the project and you are good to go.

As you noted, this is not automatic - the project file needs to be synced up with the actual filesystem. This does not happen with website "projects" because there is no project file.

like image 168
Oded Avatar answered Sep 28 '22 10:09

Oded


I just had this problem in VS 2015. Files were missing all over the web project, so didn't want to go looking for them all.

The quickest way home was to: exclude all files/folders then include them all again.

That is:

  1. solution explorer -> select all files and folders -> right-click -> "Exclude from Project"
  2. solution explorer -> click "Show all Files"
  3. solution explorer -> select all files and folders -> right-click -> "Include in Project"
like image 39
dean grande Avatar answered Sep 28 '22 10:09

dean grande