Visual Studio Quick Tip: Show All Files
Last night, before going home, I made a quick commit to save my work in progress so I could pull my changes in at home and keep working. Sometimes I run into a little issue if I’m not paying attention, and Visual Studio has made changes to the project file, but hasn’t saved them to disk.
I had added a new folder to my project, with a few code files in them. When I pulled the changes at home, the folder was added to my working directory, but wasn’t included in my project. I couldn’t create the folder again, because it already existed on disk. This had my stumped.
Solution: Solution Explorer
"Show All Files" option found on the top of solution explorer.
Honestly, I hadn’t even noticed before that solution explorer has a “Show All Files” option. Turning this on show everything in your solution folder that isn’t part of the project. I have caught myself digging through my project with windows explorer to view files in my node_modules or bower_components folder before. I don’t like to add these folders to my Visual Studio Projects because they change dynamically outside the editor on a regular basis. Had I known the option existed, I would have been using it all along!
Solution Explorer with only project files show.
If you set “Show All Files”, you can select an existing folder that is not part of the project, and “Include In Project”. This solved my issue, but it may also come in handy in the future when manually adding third-party libraries, or just viewing the node_modules folder.
Solution Explorer with all files displayed.