Windows Service And Custom DLL
-
Has anyone written a Windows Service that calls a custom DLL. I wrote the service in C# that responds to a timer every 30 minutes (this worked without any problems). Once I try and call my C# DLL which I striped down to the simplest form (it just writes an entry into the event log) it hangs and will not process. I have searched the web and MSDN and have found no answers. Any help would be greatly appreciated. Mike. :((
-
Has anyone written a Windows Service that calls a custom DLL. I wrote the service in C# that responds to a timer every 30 minutes (this worked without any problems). Once I try and call my C# DLL which I striped down to the simplest form (it just writes an entry into the event log) it hangs and will not process. I have searched the web and MSDN and have found no answers. Any help would be greatly appreciated. Mike. :((
What I'd do is attach to the service with a debugger and trace thru it. I gather your C# service is an EXE, and it's connecting to a different C# DLL. Is the EXE built with a reference to the DLL, or are you trying to do something different? Do they exist in the same directory? One possibility is there is some problem locating the DLL. There's a tool called FUSLOGVW that helps in tracking this sort of thing. Another thing to check is what account the service is running under. Some accounts, like the XP local and network service accounts have enough privilidge to write to an existing event log source, but not enough to create a new source. Creating of the new source typically happens at installation time. Hope some of that helps you. Burt Harris
-
What I'd do is attach to the service with a debugger and trace thru it. I gather your C# service is an EXE, and it's connecting to a different C# DLL. Is the EXE built with a reference to the DLL, or are you trying to do something different? Do they exist in the same directory? One possibility is there is some problem locating the DLL. There's a tool called FUSLOGVW that helps in tracking this sort of thing. Another thing to check is what account the service is running under. Some accounts, like the XP local and network service accounts have enough privilidge to write to an existing event log source, but not enough to create a new source. Creating of the new source typically happens at installation time. Hope some of that helps you. Burt Harris
Burt, Thanks. I finally got it to work over the weekend. It had to do with the account the service was running under. Acts a lot differently from XP to NT.