In Visual Studio (I'm using 2010) is there a way to chan开发者_如何学Pythonge which folder pops up by default when you go to open a file?
For Visual Studio 2017 and 2019 you'll have to navigate from Tools->Options (Alt+T, O) then Projects and Solutions->Locations, there are 3 Locations but you will only need to edit the Projects location and click OK. No need to restart VS.
There are a bunch of file locations in the registry at HKCU\Software\Microsoft\VisualStudio\10.0. The one you need to change is DefaultFileOpenLocation.
Yes in Tools->Options->Projects and Solutions->General
The only way I could configure Visual Studio 2019 Professional was through the "Developer Command Prompt for VS 2019" with vsregedit.exe as explained in this post. Adding to the windows registry didn't work.
Among the windows registry entries for VS2015 in HKCU\Software\Microsoft\VisualStudio\14.0
, there used to be these:
DefaultFileOpenLocation
DefaultOpenProjectLocation
DefaultOpenProjItemLocation
DefaultOpenSolutionLocation
DefaultNewProjectLocation
DefaultNewProjItemLocation
VisualStudioLocation
VisualStudioProjectsLocation
You can change any of these keys using vsregedit. Some of these can be changed from the interface, in Tools->Options, Projects and Solutions->Locations or through the Git Settings for the Default Repository Location. The ones I had to change through vsregedit were:
DefaultFileOpenLocation
DefaultNewProjItemLocation
DefaultOpenProjItemLocation
You can read the current values with:
vsregedit read local HKCU "" DefaultNewProjItemLocation string
The output is something like:
Name: DefaultNewProjItemLocation, Value: %USERPROFILE%\source\repos
To change the values, you can use:
vsregedit set local HKCU "" DefaultFileOpenLocation string "C:\Visual Studio Projects"
vsregedit set local HKCU "" DefaultNewProjItemLocation string "C:\Visual Studio Projects"
vsregedit set local HKCU "" DefaultOpenProjItemLocation string "C:\Visual Studio Projects"
Now when we read any of the modified keys, it will show:
Name: DefaultNewProjItemLocation, Value: C:\Visual Studio Projects
When you click the open project button the dialog that pops up defaults to something strange, I've yet to be able to figure it out (I think it might be because I am using Dropbox). At any rate, clicking the Projects link on the left (the red arrow points to it) will take you directly to the directory you specified to put new projects in. This is Windows 7 64-bit with SP1. YMMV
Also works for VS 2013. Root registry key is HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0.
I'm using VS 2017 and was being brought to the same directory time and time again, one I had not opened for a few months despite opening and creating dozens of projects afterwards. I tried resetting via Tools > Options, but to no avail. I finally created a txt file in the directory I wanted as my default and opened that through the dialog and now it's working again.
精彩评论