currently my application is on .net framework 4.8 using this I need to run a .exe file which is in .net 6.
System.Diagnostics.Process newProcess = null;
try
{
// create application
ProcessStartInfo procInfo = new ProcessStartInfo
{
FileName = "<path of the .exe file>",
Arguments = arguments,
CreateNoWindow = false,
UseShellExecute = true,
WindowStyle = ProcessWindowStyle.Hidden,
WorkingDirectory = Path.GetTempPath()
};
newProcess = new Process
{
StartInfo = procInfo,
EnableRaisingEvents = true
};
// now start the process
newProcess.Start();
newProcess.PriorityClass = ProcessPriorityClass.High;
started = true;
But after last line when I check this
System.Diagnostics.Process.GetProcessById(newProcess.Id)