Running winform Exe from Web Application

M

Mrinal Kamboj

Hi ,

I am doing some experimentation , so i created a winform exe , that on
load event creates a NotifyIcon object for System Tray Icon . Now if i
run that application normally by VS.net or double click , it works as
expected and can be debugged .

Now , i created a Web App. containing a button , which invokes the
winform exe using System.Diagnostics --> Process class .

Something lke :

System.Diagnostics.Process.Start(<Filename>) ;

where <filename> is a local drive path , where Web App. is running ,
something like @"C:\MyApp\app.exe" , but in this case it gives an
exception -- "File not found" , i was not able to understand reason for
this , so i copied the same exe in the virtual directory folder for
webApp , something like "C:\inetpub\wwwroot\MyWebApp\app.exe" .

Now this thing is able to execute the application fine , Can anybody
guess the reason for the issue .

Now major problem comes , since it is executing an exe , so i did
expected as a normal double click behaviour , executing the load event
and creating an icon in system tray , but no such thing happened ,
apparentely , if seen in TaskManager , then a process is running and as
many number of times , i click the button on web form , a process gets
added , but no load event execution .

Now i added some MessageBox.show in load event to cross check , but they
didn't triggered , confirming no execution of event .

Can anybody help me in giving relevant info in this case . Also for
processes triggered through that web application , if i try killing from
task manager , it doesn't , saying "access denied" and there's no other
way except machine shutdown . In case you need some more information let
me know that .

thanks ,

Mrinal
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

You cannot do it like that, in fact you cannot do it at all, think, what
would happen if the client is in a different machine that the server?
the app would be executed in the server and not in the client.
Most probably there will be nobody logged in the server, so there will be
not a desktop anyway.

what are you trying to do?

cheers,
 
M

Mrinal Kamboj

Hi ,

I can understand your point , but then are you saying that this is not a
right thing to do or it's not possible , to execute an exe from a web
App. even if i am doing it on same machine , as i had mentioned i am not
able to obtain the same results as double click . We can forget the Path
related issues for time being .

thanks ,

Mrinal
 
K

Kevin Yu [MSFT]

Hi Mrinal,

I agree with Ignacio that you cannot do this. This is not the right thing
to do and also impossible. Because the asp.net working process is a service
process, it does not interact with the user interface. So your every try to
show a message box or icon is failed.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top