简体   繁体   English

我可以使用Application(GUI)和Windows Service创建一个项目,并使用一个安装程序安装两者吗?

[英]Can I create one project with Application(GUI) and Windows Service and have one setup which installs both?

I am creating one service which will connect to DB and get some info process it and produce a simple csv file. 我正在创建一个服务,该服务将连接到DB并获取一些信息处理它并生成一个简单的csv文件。 On the other hand I am also creating an App to insert the data in the DB which eventually service will be using. 另一方面,我也正在创建一个应用程序,以将数据插入最终将要使用的数据库中。 Do I need to create two separate projects and two separate setup files, or can I have both service and app in one project and just one setup file which will install both? 我需要创建两个单独的项目和两个单独的安装文件,还是可以在一个项目中同时包含服务和应用程序,而只有一个安装文件可以同时安装这两个文件?

I would suggest at least four projects in total: 我总共建议至少四个项目:

  1. A Class Library project for the common functionality, eg data access. 用于通用功能(例如数据访问)的类库项目。
  2. A Windows Forms Application project or the like for the GUI. GUI的Windows窗体应用程序项目等。 This project will reference the Class Library project. 该项目将引用类库项目。
  3. A Windows Service project. Windows服务项目。 This project will also reference the Class Library project. 该项目还将引用类库项目。
  4. A Setup project to install both the GUI app and the Windows Service. 一个安装项目,用于安装GUI应用程序和Windows服务。

You may find that two separate installers would be more appropriate but it would be possible to use one for both. 您可能会发现两个单独的安装程序会更合适,但可以同时使用两个。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 一个可执行文件可以同时是控制台和 GUI 应用程序吗? - Can one executable be both a console and GUI application? 如何在C#中创建可以与GUI *或*一起运行的Windows应用程序? - How can I create a Windows application that can run with a GUI *or* as a Windows service in C#? 如何使用Inno Setup Compiler为Windows Service创建应用程序的安装项目 - How to create a setup project for a application with Windows Service using inno setup compiler 我怎样才能有一个包含两个 .Net Core 项目的解决方案并使用两个 Startup.cs 文件来设置服务? - How can I have one Solution with Two .Net Core projects and use both Startup.cs files to setup services? C#:使安装程序同时安装WPF应用程序(ClickOnce)和Windows服务 - C#: Making an Installer that installs both a WPF application (ClickOnce) and a Windows Service 如何在 Web 安装项目中创建新的应用程序池? - How can I create a new application pool in a Web Setup Project? 我可以开发Windows服务吗,可以既是Windows服务又是( <any type> )申请? - Can I develop a windows service, that can be both a windows service and a (<any type>) application? 将Windows服务添加到GUI-Windows应用程序项目 - Adding windows service to a GUI-Windows application project 如何在一个类中同时具有抽象方法和虚拟方法? - How can I have both abstract and virtual methods in one class? 如果我有两个接口,那么一个类可以继承两个接口吗? - If I have two interfaces, can one class inherit both?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM