我必须通过命令行打开 VS。它必须在解决方案中打开文件并将光标设置在特定行中。有什么办法吗?
最佳答案
这种对我有用:
devenv "Path\To\Your\Solution" /edit "Path\To\Your\File" /command "Edit.GoTo 123"
基于这些资源:
https://learn.microsoft.com/en-us/visualstudio/ide/reference/devenv-command-line-switches?view=vs-2019
https://learn.microsoft.com/en-us/visualstudio/ide/reference/edit-devenv-exe?view=vs-2019
https://learn.microsoft.com/en-us/visualstudio/ide/reference/command-devenv-exe?view=vs-2019
https://learn.microsoft.com/en-us/visualstudio/ide/reference/go-to-command?view=vs-2019
关于c++ - 使用解决方案和特定文件和行打开 Visual Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57523281/