0

I have a console application which acts as a service for my ASP.NET application. I want to make sure that service is running when the web-app starts. Note this code checks and kills any previously running processes.

protected void Application_Start()
    var svc = "C:\stuff\myService.exe";
    if (isRunning(svc))
        KillProcess(svc);
    ProcessStartInfo psi = new ProcessStartInfo(svc);
    Process.Start(psi);

When I run this from the debugger, I get a console window and I can see my output. However when I deploy the app to IIS and run it, no window -- yet I can see the process is running from task explorer as well as I'm getting expected results.

Is it possible to start the console application in it's own window on the IIS machine when Application_Start fires up?

WhiskerBiscuit
  • 4,795
  • 8
  • 62
  • 100
  • Have you seen this post: http://stackoverflow.com/questions/137660/where-does-console-writeline-go-in-asp-net – David Tansey Oct 24 '15 at 21:20
  • The following MS utility debugview may also prove helpful in regard to your question: http://tedgustaf.com/blog/2011/5/use-debugview-to-view-debug-output-from-asp-net-web-application/ – David Tansey Oct 24 '15 at 21:24

0 Answers0