I am trying to call tlbExp.exe from C# using Process.Start. I pass the command string as argument, but no matter what flavor of it, I always end up with an error message:
The system cannot find the file specified
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName)
If I try to run the command string separately in a command window while debugging, it does what it supposed to happen (tlb generated from a dll). However, I can’t get it to work from the code.
string tlb;
...
tlb += @"C:\Program files\Microsoft SDKs\Windows\v6.0A\bin\tlbExp.exe";
tlb += @""""; tlb += @" """; tlb += outputDllPath;
tlb += @""" /out:"""; tlb += outputTlbPath; tlb += @"""";
Process.Start(tlb);
You need to use the overload that accepts a
ProcessStartInfoobject:To make it generic, change the first line to this: