1

I created a c# GUI which runs an external executable (built with c++). I wanted to avoid the "file not found issue" by somehow combining the pre-existing c++ executable into the build of my c# GUI so that when I run the c# executable it already has the executable without having to search some path.

I was trying to configure my CMakeLists.txt, but I am not an expert on CMake.

Here is how I am running my executable from my c# GUI

System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.FileName = @"..\..\CLI\Debug\externalProgram.exe";
System.Diagnostics.Process.Start(startInfo);

but a path has to be specified. Meaning that the executables are separate files.

Is there some way to combine the executables on build so that they are packaged into a single executable? How would I end up running that external exectuable in c#?

Is this even possible?

Henri
  • 145
  • 13
  • 1
    Do you have the ability to re-build your C++ executable? If so, you can have your C# executable project depend on, and make calls to, your C++/CLI Project (DLL library). These links might be helpful ([here](https://stackoverflow.com/questions/12503229/c-cli-and-cmake) and [here](https://stackoverflow.com/questions/40126734/set-clr-support-to-true-with-cmake) – Kevin Jul 20 '19 at 15:40

0 Answers0