0

I'm trying to deploy a visual studio solution which has a WebApi ,Several dependent application and a console application, there are no issues in deploying of WebApi , issue is with Console Application.

I'm using deployment agent group template which does IIS web app deployment for WebAPI project and using copy files task to copy paste to copy console application to target server. For both WebApi and Console Application target server is same.

Soon after copy I've task to invoke Console Application, problem here is Application opens and close immediately . I've tried with cmd line task, batch script and powershell script in all the ways output is Same.

But I expect the console app to keep running , so kindly throw some light on this.

KNS
  • 51
  • 9
  • What functionality console app is performing here. Is it performing any operation related to the web app and dependent on it or it's independent? I think this link would be helpful - https://stackoverflow.com/questions/8474171/run-job-on-asp-net-website-service-start-in-iis – Ajay Yadav Oct 24 '18 at 10:48
  • Hi @AjayYadav, Please look about the Console App functionality and WebAPI dependency When we hit WebAPI, it writes request to service bus queue. Console app asynchronously keeps reading request from service bus queue and API call will happen, once response comes it will send back to WebAPI again. WebAPI is dependent on Console App, if Console App fails to open, the API request fails and get response as error code '504' or '500' – KNS Oct 26 '18 at 09:42
  • @AjayYadav, also the link referred by you refers installing an Quartz.NET for scheduling a task and invoke it, but in my case I've an exe of application generated I just need to invoke the console app through VSTS task, task might be command line, batch script or poweshell, post that app should keep running. – KNS Oct 26 '18 at 10:16
  • Thanks for explaining the architecture. I thought console application was not continuously running and ask was regarding running application continuously. In your RD you can first stop console application using PS task with script similar to 'Get-Process | Where-Object {$_.Path -like "*something*"} | Stop-Process', then deploy webapp and console, then start console application using script 'Start-Process "" -WindowStyle Hidden' – Ajay Yadav Oct 26 '18 at 11:52
  • see if this helps: https://stackoverflow.com/questions/52849719/best-way-to-invoke-a-console-application-and-keep-it-running-using-vsts-vnext-re – Sunny Sharma Sep 11 '21 at 18:37

0 Answers0