Reputation: 761
I have two application, first is my main application and second is application to call main application. I want to run my first application from second application. why when my first application was calling from second application, the DLL could not be loaded?
Can someone tell me and help me?
Upvotes: 0
Views: 51
Reputation: 761
I solved my problem with @Sudipta Maiti answer and I add dll into second application, and I store both off my application in one folder. :)
thank you
Upvotes: 0
Reputation: 177
try this:
Process ExternalProcess = new Process();
ExternalProcess.StartInfo.FileName = "ConsoleApplication.exe";
ExternalProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
ExternalProcess.Start();
ExternalProcess.WaitForExit();
if this won't work, kindly share the error.
Upvotes: 0
Reputation: 1709
Launch console application from another application:
using System.Diagnostics;
ProcessStartInfo processInfo = new ProcessStartInfo();
processInfo.Arguments = "Some argument";
processInfo.FileName = "Your console .exe path";
int exitCode;
using (Process process = Process.Start(processInfo))
{
process.WaitForExit();
exitCode = process.ExitCode;
}
Upvotes: 1