[英]How to update .sln (solution) file within Visual Studio 2019
[英]Run SLN file (visual studio solution) from win form application
我在ContextMenuStrip中有一个解决方案项列表,我想运行选定的项。
我设置了一个鼠标事件,并且具有目录+文件名的完整路径。
我想运行该文件,这将在Visual Studio上将其打开。
我试图用
Process.Start(pathAndFileName);
当pathAndFileName = D:\\ Code \\ MyRepoName \\ Solutions \\ TEST \\ TEST_1.sln
这将打开Windows 10选择程序以运行该文件,并且Visual Studio不在列表中,但已设置为该文件的默认程序。
private void ContextMenuStrip2_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
string pathAndFileName = ((ToolStripMenuItem)e.ClickedItem).ToString();
Process.Start(pathAndFileName);
}
您将需要启动Visual Studio(devenv.exe)并将解决方案作为参数提供,例如:
devenv.exe path\to\your\solution.sln
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.