【问题标题】:Start Visual Studio without StartWindow在没有 StartWindow 的情况下启动 Visual Studio
【发布时间】:2020-12-04 09:18:10
【问题描述】:

我需要以编程方式启动 Visual Studio (devenv.exe) 并打开解决方案。我使用EnvDte。 问题是 EnvDTE.DTE.Solution.Open 有效,但 StartWindow 不隐藏。如果我单击“无代码继续”,我将看到打开的解决方案。 如何以编程方式关闭 StartWindow?

【问题讨论】:

  • 你不能简单地使用 Process.Start 使用 ProcessStartInfo 以 sln 文件为目标并使用 OPEN 动词吗? CFdocs.microsoft.com/en-us/dotnet/api/…
  • 不,在这种情况下,我不能保证 Visual Studio 版本会启动。我需要一个准确的。
  • 在注册表中,您拥有每个已安装 Visual Studio 版本的安装路径。如果需要特定版本可以加入这个路径+common7\idde\devenv.exe 并启动一个进程
  • 它不工作。为了使用动词,我必须将进程的 FileName 设置为 sln,而不是 exe。

标签: automation visual-studio-2019 envdte


【解决方案1】:

您可以通过设置启动选项来自定义它:

点击工具->选项->环境->启动

对于启动时,打开选项选择“空环境”。

【讨论】:

    【解决方案2】:

    我找不到以编程方式关闭 StartWindow 的方法。 最好的方法是使用 /command 参数启动 devenv.exe:

    devenv.exe /command "File.OpenProject {pathToSolution}"
    

    https://docs.microsoft.com/en-us/visualstudio/ide/reference/command-devenv-exe?view=vs-2019 https://docs.microsoft.com/en-us/visualstudio/ide/reference/visual-studio-commands?view=vs-2019

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-29
      • 2020-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多