Basically from assembly main.exe I call myquery.exe.
It returns the error:
IErrorInfo.GetDescription failed with E_FAIL(0x80004005)during myquery.exe execution (myquery.exe starts, so the path is ok, but after some line of code, it stops during a LINQ query on en excel file).
The strange thing is that if I run myquery.exe directly, everything work fine (the query is ok)
Is it possible something linked to db connection, called not directly??
have you tried to debug your application? since you said the error is while executing LINQ query on a excel file. was the file is located in the right folder the application is referring? can you log the full exception stack so that we may able to find the reason for the error.
If you run an child exe from other exe, the working directory of child exe will be same as that of parent. but you can force the working directory of the child to use its own by setting the working directory as below.
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = @"childExepath\myquery.exe";
start.WorkingDirectory = @"childExepath\";
Process p = new Process();
p.StartInfo = start;