C# Process Start: Programmatically open .cs file and navigate to line number

237 views Asked by At

I'm curious if there is a way for a .cs file to programmatically open and navigate to a c# line of code (similar to ctrl + g) via

public static System.Diagnostics.Process Start (string fileName, **string arguments**);

Is it possible to use the overload string arguments to accomplish this?

I am currently using the single argument Process.Start() to open the .cs file and am copying the line# to clipboard, but the user still need to press ctrl+g && ctrl+v which is what I am trying to eliminate.

Clipboard.SetText(dr["Line"].ToString());
System.Diagnostics.Process.Start(Path.Combine(dr["Folder"].ToString(), dr["Filename"].ToString()));
0

There are 0 answers