I have a WCF Windows Service, the OnStart function:
protected override void OnStart(string[] args)
{
System.Diagnostics.Debugger.Launch(); //added for debugging for now
_Host = new ServiceHost(typeof(Service));
_Host.Open();
_Manager = new Manager();
_Manager.Start();
}
and _Manager.Start() calls Agent.Start() which has following definition (pay attention the Execute
public void Start()
{
_Thread = new Thread(new ThreadStart(Execute));
_Thread.Start();
}
The parameter Execute
is a function like following
public void Execute()
{
//mapping data stuff here
//I put a break point at some line of code in this function
//but it is not reached
}
I put a break point in Execute function code, but even if I press F11 for step in, it just does not go to the Execute
Function.
It somehow goes into Execute function now, the Execute Function code is like:
try
{ System.Messaging.Message amsg = _RequestQueue.Receive();
/// other code
}
Everytime it passes this line, the debugger is lost...It stays still and doesnot have any other actions, I dont know where it is now...
Great thanks. Any ideas are appreciated.