In VS 2008, I used to be able to create a file on the file system (like a .cpp file, for example), and then I could click the refresh button in VS and the file would show up. I have "Show All Files" checked. Note by "create a file on the filesystem" here, I mean like going out to windows explorer and creating a new file, in other words, outside of the IDE.
However, in VS 2010, this doesn't work. I have to close and re-open the solution or it won't see the file, even if I click the refresh button. I realize I can add the file through "Add New Item" and that works fine, but I use the technique above when competing in programming contests, that is, I have a separate tool which creates the file on the file system, and then I can just refresh the file list in VS and see it.
It's not a showstopper, but it's pretty annoying nonetheless. Just wondered if anyone knew a workaround for it. It's a C++ project I'm working with.
EDIT
Also, this problem seems to be isolated to C++
projects, I just tried it with a C#
console app and the refresh works ok.
EDIT2 I put an issue for this on the Microsoft connect site. I don't know if it will get any response, but I figured it's worth a shot. Here's the link.
Right-click the project and select Unload Project, then, when the project is unloaded right-click again and select Reload Project. Note that this requires that all modified files in the project either be saved or the changes in the file be discarded.
Deleting Visual Studio Installer files and then rerunning the bootstrapper might solve some update failures. Performing the following actions reinstalls the Visual Studio Installer files and resets the installation metadata. Close the Visual Studio Installer. Delete the Visual Studio Installer directory.
Open the Visual Studio Installer, and then choose Report a problem to open the Visual Studio Feedback tool. Give your problem report a title, and provide the relevant details. The most recent setup log for the Visual Studio Installer is automatically added to the Additional attachments section of your problem report.
If you are using Visual Basic, select the References page and click the Reference Paths button. In the Reference Paths dialog box, type the path of the folder that contains the item you want to reference in the Folder field, and then click the Add Folder button.
The only time I've ever seen "refresh" do this is in web site projects.. and I found it annoying that it would automatically include stuff ;).
In web apps, which is now the default, you have to click on the Show Hidden Files icon, then right click on the new file and say "include in project"
I put an issue for this on the Microsoft connect site (see EDIT2) in original question for details. MS has acknowledged that they can duplicate the problem, so hopefully they will resolve it in SP1. It does seem to be a bug.
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