Windows Service
-
Hi I have to create a windows service. While browsing the internet I found a few articles which are taking about classes which should not be used in the windows service. So far I found the following. System.Timers.Timer System.Windows.Threading.DispatcherTimer System.ComponentModel.BackgroundWorker Is that correct? Are there any aditional classes which should not be used in a windows service? Thanks in advance. Uroš
-
Hi I have to create a windows service. While browsing the internet I found a few articles which are taking about classes which should not be used in the windows service. So far I found the following. System.Timers.Timer System.Windows.Threading.DispatcherTimer System.ComponentModel.BackgroundWorker Is that correct? Are there any aditional classes which should not be used in a windows service? Thanks in advance. Uroš
It depends more on what and how your service is going to be used.
I know the language. I've read a book. - _Madmatt
-
Hi I have to create a windows service. While browsing the internet I found a few articles which are taking about classes which should not be used in the windows service. So far I found the following. System.Timers.Timer System.Windows.Threading.DispatcherTimer System.ComponentModel.BackgroundWorker Is that correct? Are there any aditional classes which should not be used in a windows service? Thanks in advance. Uroš
In general you have to avoid everything that does something with the GUI. Services that try to open a window or something in that way will hang up (except services that can interact with the desktop, but don't use this anymore because it becomes obsolete). But you can use the class System.Timers.Timer in a service, you can't use the System.Windows.Forms.Timer!
Greetings Covean
-
It depends more on what and how your service is going to be used.
I know the language. I've read a book. - _Madmatt
-
In general you have to avoid everything that does something with the GUI. Services that try to open a window or something in that way will hang up (except services that can interact with the desktop, but don't use this anymore because it becomes obsolete). But you can use the class System.Timers.Timer in a service, you can't use the System.Windows.Forms.Timer!
Greetings Covean
-
What do you mean how? The service communicates with an .net application using WCF and than releys data to ethernet device using tcp sockets. Uroš
You seem to be missing the point. Perhaps more research on what a Windows service is, and isn't, will clarify it for you.
I know the language. I've read a book. - _Madmatt
-
I know I should avoid anything that has to do with UI. But Background Worker does not exectly fit that criteria. Is the information regarding the Background worker event corrent?
I can't see any reason why BackgroundWorker shouldn't work in a service. Its just using delegates and normal events. I also googled a little bit. It says it works on a service but this class is designed for UI purposes only so you shouldn't use it. Just use a normal Thread, this will work in any case.
Greetings Covean
-
I can't see any reason why BackgroundWorker shouldn't work in a service. Its just using delegates and normal events. I also googled a little bit. It says it works on a service but this class is designed for UI purposes only so you shouldn't use it. Just use a normal Thread, this will work in any case.
Greetings Covean
I can't see it either. I just read it on: http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic30104.aspx
-
I can't see it either. I just read it on: http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic30104.aspx
Did you read the last message on this board?
"It works fine in a console or service app with no forms. The delegates are run on thread pool threads instead of the UI thread. So there is nothing special going on, just delegates, BeginInvoke, and events. Try it yourself."
Greetings Covean