Base solution for your next web application
Open Closed

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


User avatar
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)
  • User Avatar
    0
    maliming created
    Support Team

    This is not a good practice.

  • User Avatar
    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?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @timmackey

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

  • User Avatar
    0
    timmackey created

    WorkingDirectory confirmed.

  • User Avatar
    0
    ismcagdas created
    Support Team

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

  • User Avatar
    0
    timmackey created

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