I am new in creating windows services using C# framework 4.0, i have made a windows application that uses a DLL files to connect to a finger print attendance terminal.
but i am confused in how to convert windows app to windows services.
as i followed the tutorials i can run and install a simple services. but how to add new event in windows service
so first i add reference to my DLL file in project. second i added this code in the InitializeComponent method
private void InitializeComponent()
{
this.ServiceName = "MyService";
AxBioBridgeSDK.AxBioBridgeSDKX MyBio = new AxBioBridgeSDK.AxBioBridgeSDKX();
MyBio.OnAttTransaction += new AxBioBridgeSDK.IBioBridgeSDKXEvents_OnAttTransactionEventHandler(this.axBioBridgeSDKX1_OnAttTransaction); // this is the event handler function
}
#endregion
private AxBioBridgeSDK.AxBioBridgeSDKX MyBio;
}
and in the OnStart()
i add code to open connection with terminal.
after i install the service and try to run it i get this error :
Windows could not start the "MyServiceName" service on Local Computer.
Error 1053: The service did not respond to the start or control request in a timely fashion.
Any help?