Hello,

I am trying to use my .NET 4.5 program to, among other things, launch a Cygwin process and read its log file. The code is pretty simple:

string cygwin_exe_path = "C:\(path)\teLeap.exe";
ProcessStartInfo cyg = new ProcessStartInfo();
cyg.FileName = cygwin_exe_path;
var tleap_proc = Process.Start(cyg);
tleap_proc.WaitForExit();

When I build the program in Visual Studio 2012 and then run it by manually clicking it in Windows Explorer, it runs perfectly and the Cygwin process launches as expected. However, when I run my program via the VS2012 debugger, I get a popup window that says "The program can't start because cygwin1.dll is missing from your computer." This is a huge problem for me because I have a lot of subsequent code which needs debugging and requires the cygwin process's log file to execute.

To clarify, I have no need of debugging the Cygwin program; I already know that it works. Is there any way to get it to run (by pointing it to the cygwin1.dll file) when debugging my program?

Recommended Answers

All 3 Replies

Sorry, in the string cygwin_exe_path above, the filepath contains double slashes rather than single: C:\(path)\teLeap.exe. The forum won't let me edit for some reason.

Are you moving the files anywhere after they are built. You might have to change the ProcessStartInfo's current working directory so that it can correctly identify the cygwin dll. Or, you could copy the dll file to the directory you're working in. Or, change the current working directory to the same location of the file you are trying to start.

Thanks! Moving Cygwin1.dll to the debug directory worked like a charm. Thanks a ton!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.