asp.net web api2 - Can you call an executable from a Owin self hosted Web API restfull service -


i trying set self hosted owin webservice spins executable process.

the same code use calls executbal simple test console application not call self hosted service instance. don't see exception don't see logs of kind. not sure possibly wrong. starting think not allowed.

        [route("startapplication/{application}/{parameters}/{workingdirectory}")]         public ienumerable<string> startapplication(string application, string parameters, string workingdirectory) {         logger.loginfo("startapplication restfully called");         runresults runresults = new runresults {             ...         };         application = new uri(application).localpath;               try {             if (file.exists(application)) {                 using (process proc = new process()) {                     logger.loginfo(string.format("attempting start application: {0}", application));                     proc.startinfo.filename = application;                     proc.startinfo.arguments = parameters;                     proc.startinfo.workingdirectory = workingdirectory;                     proc.startinfo.useshellexecute = false;                     proc.startinfo.redirectstandardoutput = true;                     proc.startinfo.redirectstandarderror = true;                     proc.outputdatareceived += (o, e) => runresults.output.append(e.data).append(environment.newline);                     proc.errordatareceived += (o, e) => runresults.output.append(e.data).append(environment.newline);                     proc.start();                     proc.beginoutputreadline();                                             proc.beginerrorreadline();                     proc.waitforexit();                     runresults.exitcode = proc.exitcode;                     logger.loginfo(string.format("application has started: {0}", application));                 }             }             else {         ...             }         }         catch (exception e) {             ...         }         return new string[] { "hello", "world", "jive", "turkeys" };     } 

i not doing right. know thinking... insecure. internal app accessed people in right security groups. if aren't in, can't call controller. protected call triangle authentication. details of besides point of post. ideas?

in article writer developed windows service having full os capabilities without security restriction web servers , embedded self host web api in order communicate it, neat approach , clean there enough room of isolation of each of technologies used. answer questions link


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -