【问题标题】:creating a windows service from existing web application从现有的 Web 应用程序创建 Windows 服务
【发布时间】:2013-12-13 14:58:41
【问题描述】:

我在 .net 中有一个 Web 应用程序,它在检查 .CSV fie 后创建更新数据库。 现在,我想创建一个 Windows 服务来做同样的事情。我该怎么做?

【问题讨论】:

    标签: .net windows-services


    【解决方案1】:

    一种解决方案是将逻辑(即检查 .csv 文件并更新数据库)重构并提取到 Class Library 中。然后,您可以从当前的 Web 应用程序中引用该库。接下来,您将创建一个 new Windows Service project 并引用同一个库。请注意,您需要将一些 web.config 设置(连接字符串)复制到 Windows 服务中的 app.config。

    根据您希望 Windows 服务拥有多少功能,您可以查看这个开源项目来托管/运行您的 Windows 服务:https://github.com/jgoz/muster

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-14
      • 2013-05-28
      • 1970-01-01
      相关资源
      最近更新 更多