Every time I load my project I do organize my workspace into 3 "new solution explorer view". One Solution Explorer for the views folder, one for the models folder and the last one for the controllers folder.
However when I close and reopen my project it is set back to the default workspace. Is possible to keep those created solution explorer views ?
The Save workspace option don't work with multiples solutions explorers.
Unfortunately, the short answer is "you can't". I have been attempting to find a solution utilising the MS Macro addin, and some of the other tools available, but none of them seems to be able to automate the opening of additional solution views, let alone a way of persisting them once they are set up.
I was quite surprised that the "Save Window Layout" feature in VS2015 doesn't allow you to do this either. It simply ignores any additional solution views. My theory on this is that, as the views are solution specific, it doesn't make sense to have them persisted as a default for the entire environment.
Here is a rather dirty solution I came up with in the last hour. It uses an AutoHotKey script which does what you would do by hand. The case in the code is quite specific, since I want to open two panes on top of each other each one searching for a specific search term, but you can easily modify the code to suit your needs.
Have the solution Explorer on Docked Mode and on "Show all Files" view. Double click the script, which should have the ending .ahk
with AutoHotKey installed. You have 2 seconds to Alt+Tab to Visual Studio, where the script will do it's thing. When it is done, close the original Solution Explorer by hand.
FolderPos = 2 ; Position of Target Folder, Example in the picture below
XPosFirst = 24 ; How many times to press right
YPosFirst = 42 ; How many times to press down
SearchTermFirst = "cpp" ; Text to search in the explorer
XPosSecond = 22
YPosSecond = 13
SearchTermSecond = "hpp"
InitiateMove() {
Send !{Space}
Send M
}
NewSolutionExplorer() {
Send {AppsKey}
Send N
}
ExitSearch() {
Send {Down}
Send {Up 5}
Send {Down}
}
BlockInput MouseMove
Sleep 2000
SetKeyDelay 10
Send ^!l
Send {Down %FolderPos%}
NewSolutionExplorer()
SetKeyDelay 80
InitiateMove()
Send {Right %XPosFirst%}
Send {Down %YPosFirst%}
SetKeyDelay 10
Send {Enter}
Send ^;
Send %SearchTermFirst%
ExitSearch()
NewSolutionExplorer()
SetKeyDelay 80
InitiateMove()
Send {Right %XPosSecond%}
Send {Down %YPosSecond%}
SetKeyDelay 10
Send {Enter}
Send ^;
Send %SearchTermSecond%
ExitSearch()
BlockInput MouseMoveOff
ExitApp
FolderPos
Example: Folder src is on position 2For VS2017 and VS2019 I found extension 'Multiple Solution Explorer Tools'. Only problem - it does not maintain view windows position and size after load.
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