Search code examples
.netvb.netvisual-studiowindows-services

.Net Project Contains Forms, Classes, Windows Service


So I have this project I am working on. In short its a app that integrate data from different systems (Print Management, Telephone Management, Mail Management) to Cost Recovery Systems.

enter image description here

Its a project that contains:

  • Forms for settings and viewing logs.
  • Classes that manage integration functions for each PMS, TMS, MMS and CRS.
  • Windows Service that triggers integration tasks on set schedules.
  • Entity Framework that connects to a data model used for managing clients, servers, and logs.

The depencies of objects is shown below: enter image description here

My question is can all these components exist in the same project (which is a Windows Forms App). For if I publish or create an installer for this project, I need to sure that once installed, the Windows Service will be listed under Services.

UPDATE:

So based on comments: Would this then be a better approach. Windows App Project Windows Service App Project that references the Windows App Project in order to use its module's functions. Installer that installs both the App and WS.

Should I then


Solution

  • jmc's comment is accurate; you can't put these in one project. You can put a windows service project and a windows forms project into a single overall solution though. How all this is bundled up for deployment/install is a separate question though. You could certainly have an install process that installs a windows service and a windows forms app but the individual projects will have different outputs (e.g. one exe that is a windows service, another that is a forms app, a third project that outputs a DLL that represents a shared data layer used by both EXEs..)