Actually i got the solution... I found it by searching in google...this is the link that helped me......
http://www.daniweb.com/forums/thread31105.html Take a look at this link.. Thanks, Ram On Mon, Apr 27, 2009 at 8:48 PM, Vivek SHANTHARAM <[email protected]>wrote: > Are you running ur code as windows service or console service?? in case of > a console service you wouldnt require an installer property and all. Try > giving these lines, > > console.writeline("services started as console"); > console.readline(); > > with this you can "retain" ur console service. hope this helps. > > On Mon, Apr 27, 2009 at 10:39 AM, [email protected] < > [email protected]> wrote: > >> >> Hi, >> >> I have created a windows service which contains a fileSystemWatcher. >> In the created event of file watcher, i am trying to start a console >> application...as below.. >> Process p = new Process(); >> p.StartInfo.Arguments = (arg.Replace("\\", >> "/").Replace(" ", "*")); >> p.StartInfo.WindowStyle = >> ProcessWindowStyle.Normal; >> p.StartInfo.FileName = _appPath; >> Boolean processStarted = p.Start(); >> >> The problem iam facing is.. The process after starting is getting >> killed within 5 secs of time. I dont know why its happening like that. >> The console app contains code that has some IO operations, etc. >> >> Please help me..Thanks in Advance.. >> >> Ram. >> > > -- S hrewd I mpartial T alented A lluring R esolute A ggressive M odern. Mobile:-9885291971
