How to invoke an executable desktop application from within an ASP.NET MVC application?

That isn't recommended for use on web servers) But sure; you can shell an exe with Process. Start or if it is a . NET exe you can either add a reference directly to the exe and use it as a library (if it has appropriate code) There is also a way to run it in-process via AppDomain.

ExecuteAssembly not sure this latter is a good idea on a web-server, though... especially if the exe talks to stdout For getting the image back to the client, you would want this processing to happen (perhaps with caching) in a route that uses return File(...) from MVC to simulate the image stream.

If you mean "to run on the user's machine", then not "as is" - you might want to look at Silverlight for that. If you mean "to use at the server", then it will of course depend on how it operates (whether it prompts for input etc), and how it works (does it use GDI+, for example? That isn't recommended for use on web servers).

But sure; you can shell an exe with Process. Start, or if it is a . NET exe you can either add a reference directly to the exe and use it as a library (if it has appropriate code) There is also a way to run it in-process via AppDomain.

ExecuteAssembly - not sure this latter is a good idea on a web-server, though... especially if the exe talks to stdout. For getting the image back to the client, you would want this processing to happen (perhaps with caching) in a route that uses return File(...); from MVC to simulate the image stream.

– ebb Feb 18 at 12:49 @ebb - see the big yellow box on MSDN: msdn.microsoft. Com/en-us/library/system.drawing. Aspx – Marc Gravell?

Feb 18 at 12:52 Garvell - Ah I see... Do you know any good alternatives for web apps? - At the moment I'm using GDI in my own to generate thumbnails... – ebb Feb 18 at 13:00 @ebb - I haven't had cause to look – Marc Gravell? Feb 18 at 13:00.

Use the system.Diagonstics. Process class to call the exe with a StartInfo object to pass the appropriate arguments.

Yes but this executes on the server only where eventually there is nobody logged in at all. – Davide Piras Feb 18 at 11:51 You can execute an exe in the context of a server. This only becomes a problem where you need access to resources that are not available to the server user.

If this is the case then the best bet is to take out the common classes and sue them from a dll. – Kell Feb 18 at 14:48.

Please take look to the following links. Hope it will solve your issue. velocityreviews.com/forums/t100792-execu... dotnetslackers.com/Community/blogs/haiss....

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions