---
title: "在Windows Service中调用Web应用程序"
author: "winzenghua"
date: "2007-08-15T17:24:00Z"
tags: []
slug: "windows-service-web"
draft: false
lastmod: "2007-08-15T17:24:00Z"
id: 952951
url: "https://java4gis.iteye.com/blog/952951"
---

场景：已经存在一套WEB应用程序框架，参数配置在web.config 文件中，严格按照MVC模式划分。

现在Windows Service程序直接用到MC层的dll，而不用再进行重复配置和代码编写。

解决方案注意点：

1\. 在Windows Service程序中调用web虚拟目录

2.该 Windows Service程序要依赖IISADMIN，否则可能出错。