4

I have a class library in VB.NET that does a NET-envelope for an USB device driver.

There is only one function of that driver that I could not envelope in a traditional class, but I had to put it in a Windows Service as described here: Sharing a class property (field) between applications

The Windows Service works fine, but I have now two projects for my NET-envelope: the one with the class library, the second with the windows service and I do not like the idea to maintain two distinct projects for the same driver.

Is it a good practice (or even if possible) to add a windows service class to a normal class library (without creating its own project as described in the vb tutorial)? I know, in any case I should create a separate setup only for the windows service, but in this way I could have together all the classes that envelope my usb device driver in only one project.

Community
  • 1
  • 1
gingo
  • 468
  • 1
  • 4
  • 18

1 Answers1

2

I think that it depends on the size of your project. A simple service that does one thing with a minimal amount of code would be fine as a single project/EXE.

A service that calls a database, builds objects, and does reporting would be better as multiple projects (one EXE and several support DLLs).

It's a design decision, not a code decision.

Carl Onager
  • 4,112
  • 2
  • 38
  • 66