I have a winforms applications which is reading strings using sockets and the sockets are under backgroundWorker thread.
Things are working fine, but as per the new company standards my manager wants it to be run as service rather putting this winforms application in the startup folder always.
The problem is that we are using below line of code in this winforms application
Invoke(new MethodInvoker(
delegate { _logger.Error((String.Format("Error: {0}", _socketError))); }
));
Can somebody guide what ca I do to use the above line of code in the windowserverice project
please suggest
Thanks
Update: I need to use invoke because this statement is running in the DoWork event of backgroundWorker component.
Since
_loggeris just writing to a log file, I do not understand the original intention behind usingInvokein the first place. I think you will be safe replacing that line with: