Best practices when creating tests and deploying Windows services?

i building a small windows service (not a web service) that periodically checks some data and builds on that and calls the class library to do some work

BTW: this is the first time i try to create a windows service

0


a source to share


1 answer


Windows services are, by definition, difficult to test because you must always install and uninstall them every time you change something.

Your best bet is to decouple the BL you write for maintenance and put it in a separate class. After that, you can write a simple win desktop application where you will use and test this BL class. Once testing is complete, it's easy to incorporate this same logic into your Windows service project.



To debug a Windows service, you need to connect to a process, and after that it is very easy to test the code directly.

Hope it helps ...

+5


a source







All Articles