0

I have created "Web Site Project", in that project I have added "ASMX Web Service". I am opening WPF application using Web Service call.

Here is the sample:

[WebMethod]
public void strt()
{
  Process.Start(@"C:\application.exe");
}

My web service URL is like this:

"localhost:12345\WebSite.asmx

Now, whenever I run this web service and call this method from Visual Studio:

"WPF starts running and opens the WPF start Windows"

Then I have configure this Web Site to IIS and bind to Port 82. Now my project URL is like this:

localhost:82\WebSite.asmx

I have configured all things right. I am able to Browse to my Directory from IIS.

Now when I go to "ASMX Web Service" and call "Web Service Method" from IIS, The method gets called and also "WPF application" starts, but main problem is

"WPF is running in background, not opening the start Windows of WPF".

How to solve this issue? I have to configure this project in IIS and show Star Up Window from IIS.

Any help would be greatly appreciated. Thanks!!

Nitesh Kothari
  • 890
  • 12
  • 27
  • @CodeCaster then how to deal with this? because my web service will be called from any client like Java,etc. and I have to show WPF window. – Nitesh Kothari Jan 30 '15 at 14:54
  • @Nitesh, you should change your design to have an event driven, perhaps queue based solution where you would have your WPF app subscribe to events that would then be raised from the web service (by putting a message on a queue or similar). Having apps hosted by IIS directly launch external processes that require a user interface is poor design, even if it was somehow possible. – user469104 Jan 30 '15 at 14:57
  • You cannot start an executable on the client from a web server. If you mean you will install a web server on the client: this will run as a service, which is isolated from the desktop the user sees. – CodeCaster Jan 30 '15 at 14:58
  • To Nitesh's point, this is not a duplicate of "how to run .exe on client from server code?", this question is "how to launch.exe with user interface on server from server code hosted by web server?" – user469104 Jan 30 '15 at 15:21
  • Please convince me why it's not. You're trying to start an executable on the client from a webserver, no? – CodeCaster Jan 30 '15 at 15:21
  • @CodeCaster I have hosted service, so its my server, and other clients will call, my server will get call and run "exe" on my server. Thanks – Nitesh Kothari Jan 30 '15 at 15:38
  • @user469104 yes, you are right, is there any other way to do so or continue to use "IIS Express". – Nitesh Kothari Jan 30 '15 at 15:39
  • It does run the exe on your server. That doesn't mean your clients will see that exe's GUI: it will run on the server in session 0, an "invisible" desktop. What you want sounds like [Silverlight](http://www.microsoft.com/silverlight/). – CodeCaster Jan 30 '15 at 15:39
  • @Nitesh - see my prior comment. You should change your design. – user469104 Jan 30 '15 at 15:51

0 Answers0