Quote:
I'm expecting to launch the application on the client.
Well, there's you problem.
Code running on the server
cannot launch an application on the client.
It might
appear to work when you debug your code locally. But that's only because, in that specific situation, the client and server are the same machine.
As soon as you try to run your code on a real server, one of two things will happen. In the best case, your code will crash indicating that you can't launch an interactive application on the server. In the worst cast, it will launch the application on the server, where nobody will ever see it, and then hang waiting for someone to log in to the server and close the application.
And no, before you ask, you won't be able to launch the application from JavaScript running on the client either.
And linking to a UNC path from a web site won't work; most modern browsers will explicitly block such links.
The best you can do is to transmit the exe file in the
Response
with appropriate headers
(content-type application/octet-stream
, and possibly a content-disposition as well). The user should then be given the choice to save, run, or discard the file.
(And no, you can't force them to pick the "correct" option here.)
But doing that from your
Page_Load
event handler is generally not a good idea. You can't return any other content along with the file download, so the rest of your page code will be irrelevant.