1

以下の例のようにStudioShellを使用して新しいウィンドウ構成を作成すると、Visual Studio 2012を終了するときに構成が保存されません。この変更を強制するために実行する必要のあるコマンドレットはありますか?

cd dte:\windowconfiguration
new-item Work

ls dte:\windowconfigurations

Location: studioshell\PSDTE::WindowConfigurations
Available Operations: d+ <      

           Name                                                                                                                               
---------- ----                                                                                                                               
  ~<>    i Debug                                                                                                                              
  ~<>    i Design                                                                                                                             
  ~<>    i NoToolWin                                                                                                                          
4

1 に答える 1

1

Window configs are tricky and seem to have changed behavior from 2008 to 2010 (and by proxy 2012).

TL;DR: use new-item to create a new config, then immediately call invoke-item on the new config. the config will then be saved when you exit visual studio and reloaded when you start visual studio again.

Window configurations are saved to the %APPDATA%\microsoft\visualstudio\11.0 folder as winprf (windows profile) xml files. In addition there is a windows.index file that is basically an index of config names to winprf files.

using new-item adds an entry to the windows.index file; however it does NOT force the creation of the winprf file that actually stores the windows settings. This seems to be done only if the windows configuration is applied (using invoke-item). This is different from the 2008 behavior, where the dte operations backing new-item would magically create the index entry and winprf file for you.

I've changed the behavior of new-item for the windows configuration path to force the persistence of the windows configuration. It'll be available in the next maintenance release; until then the workaround is this:

new-item dte:/windowconfigurations/myawesomeconfig # this creates the index
invoke-item dte:/windowconfigurations/myawesomeconfig # this forces VS to acknowledge the profile and save it on exit.
于 2013-03-02T20:41:54.183 に答える