Hi,
What I do (no matter what OS) is that the OnStart does nothing more than
spawn a thread that is where all the work is performed.
In the thread you can use a Sleep to hold for a given time. This allows you
to attach your debug session to the process.
The waiting time is defined in the config file, so if it's 0 you wait
nothing and the process start as expected (this would be teh case when the
process is running alone).
OnStart()
{
new Thread( new ThreadStart( StartingPoint)).Start();
}
void StartingPoint()
{
if ( Configuration.AppSettings["StartDelayTime"] != "0" )
{
Thread.Sleep(
Convert.ToInt32(Configuration.AppSettings["StartDelayTime"] ));
}
.... code
}
--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"ink" <in*@notmyemail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hi all,
I cant seem to debug my windows service on my Vista machine.
It seems it has something to do with 0 Session.
What I would normally do is add the following code to my OnStart() but it
does not work on Vista
#if DEBUG
System.Diagnostics.Debugger.Break();
//System.Diagnostics.Debugger.Launch();
#endif
I found this article but I am not sure this is what I am looking for.
http://blogs.msdn.com/cjacks/archive...ows-vista.aspx
I have tried it and it seems for be awfully low level.
Can any one help with this.
Thanks,
ink