none
Lauch application in shell with a WCF webservice RRS feed

  • Question

  • Hello,

    I made a WCF webservice, with some function to use an ASP.NET website with an ERP we developped.

    I created a sub wich lauch an application with arguments, to automaticly print a label.

    When I start my webservice in visual studio, in debug mode, it works perfectly : my process in lanched, and my label is printed. But when I deploy my webservice in IIS, on the same PC, my exe is launched but immediatly killed, withtout printing my label, and even executing my code (I write in a text file "ok" at the begining of my sub in my ERP, this file was not created....

    Is there something to set on my IIS server (a user...) ?

    Here is my code in my webservice :

     Shell("C:\Program Files (x86)\Videor Informatique\Everest\PJTGestcom.exe -EDIT -S:""OLIVIER-PC\SQL_OP"" -B:""MYDATABASE"" -ETQ:9145 -MAG_ETQ:1 -IMP:""EPSON TM-T20II Receipt5"" -FORMAT_ETQ:""ARTICLE"" -NB_ETQ:1", AppWinStyle.Hide)

     Is there another way to launch executable from my webservice ?

    Thanck you in advance.

    Sincerely

    Thursday, August 3, 2017 3:26 PM

Answers

  • Hello,

    When running in IIS the process is in the context of the application pool.  One way of handling this would be to change the identity of the application pool to a user that has permission to execute the shell command.  

    Another approach would be to give the app pool identity more permission.  This post should get you heading the right direction: https://stackoverflow.com/questions/7334216/iis7-permissions-overview-applicationpoolidentity


    Cheers, Jeff

    Thursday, August 3, 2017 8:28 PM

All replies

  • Hello,

    When running in IIS the process is in the context of the application pool.  One way of handling this would be to change the identity of the application pool to a user that has permission to execute the shell command.  

    Another approach would be to give the app pool identity more permission.  This post should get you heading the right direction: https://stackoverflow.com/questions/7334216/iis7-permissions-overview-applicationpoolidentity


    Cheers, Jeff

    Thursday, August 3, 2017 8:28 PM
  • Thank you, it works perfectly !!!!!!
    Friday, August 4, 2017 2:29 PM