Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is the question from one of my colleague. Please help him.

[Start]
Question is :-
When I am invoking a windows application (.exe) from a Web page on a button click event, it throws an Exception

Message: System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for dataProcessors: Cannot load import assembly (..ProjectPath\bin\Debug\SalesDataProcessor.ConsoleHost.exe.Config line 27)

The Windows application is working fine independently.
My web application and windows application are at two different location.
Also I am able to call/open any other window application using the same process, but its not working for the above .exe.

C#
System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo(filePath, "");

//System.Diagnostics.Process p = System.Diagnostics.Process.Start(info);
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo = info;

//while (p.Responding)
while (!IsProcessOpen("SalesDataProcessor.ConsoleHost"))
{
     p.Start();
}

Above is the code i am using to start a Windows Process from a web page. Any help will be appreciated.

Thanks!!!
[End]
Comments
Richard MacCutchan 6-Feb-13 3:44am    
Check the location of that file is correct on the target machine. By the look of the text above it is not.
The file path is correct.
And is even working for any other .exe file.
But not for this particular .exe.
Richard MacCutchan 6-Feb-13 9:03am    
So have a look at line 27 of that file to see what is missing. Error messages are provided to help you, but you need to read them.
Abinash_Sahoo 26-Feb-15 17:22pm    
It seems there is an issue at line 27 of your application configuration file! Did you recheck the file?
Hey Abinash

This was a question two years back from one of my colleague. He has left the company. So, I have no updates on this. Sorry.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900