Open Closed

How to execute a Process that is not in the Abp/Zero universe? #7634


0
timmackey created

I have a Console Application that was created independently of Abp/Zero. How can I launch that Process from within my Zero app? I tried the following code, but the Console app is not Executed.

System.Diagnostics.Process examCreateProcess = new System.Diagnostics.Process();
examCreateProcess.StartInfo.WorkingDirectory = workingDirectory;
examCreateProcess.StartInfo.FileName = "MyConsoleApp.exe";
examCreateProcess.StartInfo.Arguments = operation + " " + userId + " " + rootfolder;
examCreateProcess.Start();

6 Answer(s)
  • 0
    maliming created

    This is not a good practice.

  • 0
    timmackey created

    Why is it not a good practice? How is a legacy Console app that was created outside the Abp/Zero universe executed?

  • 0
    ismcagdas created

    Hi @timmackey

    Your code seems fine. Did you check the value of WorkingDirectory ? It might be causing the problem.

  • 0
    timmackey created

    WorkingDirectory confirmed.

  • 0
    ismcagdas created

    Is it an empty console app ? If so, we can try it locally and let you know the result.

  • 0
    timmackey created

    The resolution of #7635 obviated a need for this approach.