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.
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.
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.
Navigate to your project under the Visual Studio Projects folder. Right-click the project and select Delete. A delete confirmation appears. Click OK.
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.
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With