Background:
I have a console application which queries our SCOM 2007 R2 server for active Alerts. It checks for new Alerts every 15 minutes and works fine.
Need:
I need to convert this console application to a Windows Service and have done so using virtually the same code, access logic and the EnterpriseManagement.OperationsManager libraries.
Problem:
When I install the Service it never executes the Alert checking and I get a 'Bid' warning in the Event logs: System.DllNotFoundException: Unable to load DLL 'MOMBIDldr.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Bid.internalInitialize().
I have a copy of the MOMBIDldr.dll which I have tried to add to my project, but when adding, I receive the error: "A reference to '...MOMBIDldr.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component." I have confirmed its accessability
Question:
How can I get my SCOM Alert checker console application to work as a Windows Service when the MOMBIDldr library is required, but I cannot add it? Why is MOMBIDldr library required for a Windows Service but not a console application?
Thanks.