visual-studio Visual Studio 启动时自动打开源代码管理资源管理器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2907614/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 12:01:58  来源:igfitidea点击:

Automatically open Source Control Explorer when Visual Studio starts up

visual-studio

提问by David McClelland

We use Visual Studio 2008/2010 and Team Foundation Server here at work. Sometimes I want to just use the Source Control Explorer. Is there a way to have Visual Studio launch and automatically open Source Control Explorer? I'm thinking ideally of having a shortcut on my taskbar or desktop that does this automatically.

我们在工作中使用 Visual Studio 2008/2010 和 Team Foundation Server。有时我只想使用源代码管理资源管理器。有没有办法让 Visual Studio 启动并自动打开源代码管理资源管理器?我正在考虑在我的任务栏或桌面上设置一个自动执行此操作的快捷方式。

And yes, I do know that if the Source Control Explorer window was open the last time I shut down Visual Studio it will open up, but I am wanting to always go straight to Source Control Explorer even if I had closed that window previously.

是的,我确实知道如果源代码管理资源管理器窗口在我上次关闭 Visual Studio 时打开,它将打开,但我想总是直接进入源代码管理资源管理器,即使我之前关闭了该窗口。

回答by David McClelland

OK, I figured it out - Source Control Explorer is available in the Visual Studio IDE as a command (View.TfsSourceControlExplorer), and the Visual Studio executable (devenv.exe) provides the /Commandargument to execute a command after the IDE starts up. In my case, I have created a desktop shortcut with the following command line:

好的,我想通了 - 源代码管理资源管理器在 Visual Studio IDE 中可用作命令 ( View.TfsSourceControlExplorer),并且 Visual Studio 可执行文件 (devenv.exe) 提供/Command参数以在 IDE 启动后执行命令。就我而言,我使用以下命令行创建了一个桌面快捷方式:

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" 
         /Command View.TfsSourceControlExplorer

NOTE:if you really want this to load fast and don't need any other addins (in my case ReSharperand .NET Reflector Pro) then you can also add the /SafeModeargument to the command line.

注意:如果您真的希望它快速加载并且不需要任何其他插件(在我的情况下是ReSharper.NET Reflector Pro),那么您还可以将/SafeMode参数添加到命令行。

回答by Dudly

I use TFS every day at the office. I set up these things so that I can get to our Source repository quickly... (We use VS 2008)

我每天在办公室使用 TFS。我设置了这些东西,以便我可以快速访问我们的源代码库......(我们使用 VS 2008)

  1. In Visual Studio... Open Tools->Options. Select Environement->Startup. In the "At startup" dropdown, select "Show empty environment". If have Source Control Explorer when close Visual Studio, it will be the only open window when you start Visual Studio again.

  2. In Visual Studio... Open Tools->Options. Select Environement->Keyboard. Find the command: View.TfsSourceControlExplorer. Set a shortcut for the command. (I like Alt-S)

  1. 在 Visual Studio 中...打开工具->选项。选择环境->启动。在“启动时”下拉菜单中,选择“显示空环境”。如果在关闭 Visual Studio 时有源代码管理资源管理器,则再次启动 Visual Studio 时它将是唯一打开的窗口。

  2. 在 Visual Studio 中...打开工具->选项。选择环境->键盘。找到命令:View.TfsSourceControlExplorer。为命令设置快捷方式。(我喜欢 Alt-S)

Enjoy

享受