Calling a static method from within a C# windows service causes the service to hang?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Just encountered a bizzare issue that I hope someone can explain. We've
built a generic hosting service in C# (something like SVCHost) that calls a
logger class for logging purposes. The logger class has only static methods
(including a static constructor).
We registered the generic host as two seperate services, each running a
different set of classes. When we try to start both services the first one
starts fine, but the second one immediatly hangs on the first call to the
logger class and simply doesn't return. As for as we can tell this happens
only with services.

Any idea someone?
 
Hi,

Each service will have a different AppDomain, meaning that each one will
have a different copy of the Logger class, maybe the problem is taht you are
initializating the class on one service and not in the other.

Cheers,
 
These are two separate Processes (looked in the task manager), so I would
assume each one will initialize it's own instance. Therefore I can't
understand why the second service hangs.

- Homer
 
Back
Top