Reusable windows service project

257 views Asked by At

I've made a windows service with a timer (I've seen discussions about timer-driven windows services vs windows task scheduler, and still want to go with my own windows service) that runs some business logic. To separate my concerns and make it easy to test & run manually, all my business logic is in a separate project that I also reference in a windows forms tester GUI. Now I want to make another timer-driven windows service in another solution that runs some other business logic, so I'm thinking I don't want to end up with several codebases for my windows service and timer, so I'll reuse them from this solution, and go write my other business logic project.

How does this work? Am I going to end up with the same DLL name for the service project in both solutions? If they run on the same server, that will cause problems. It's such a small piece of code, I almost feel like the service isn't worthwhile as its own project, or isn't worthy of reuse, but I also hate the idea of not reusing it.

Also, I dislike the notion of reusing, say, just one or two .cs files and not the whole project, not only because that seems like it goes against the intentions of .Net, but also because our Mercurial source control makes that cumbersome.

What's the right way to approach this?

0

There are 0 answers