通过安装Windows窗体应用程序的安装程序来托管WCF [英] Hosting WCF by installing Setup of Windows Form Application
本文介绍了通过安装Windows窗体应用程序的安装程序来托管WCF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Guys,
我有一个Windows窗体项目,它正在使用WCF服务,这是同一解决方案中的一个单独项目。
现在我为这个Windows窗体应用程序创建了一个安装程序并安装它。
当我运行已安装的应用程序时,它没有托管服务。
怎么能我通过该应用程序的安装程序安装此WCF服务?或者有没有其他方法来解决这个问题。
任何帮助将不胜感激
Hello Guys,
I have a windows form project, which is consuming a WCF Service which is a separate project in the same solution.
Now i created a setup for this windows form application and installed it.
When i run that installed application, it doesn't host the service.
How can I host this WCF service with the setup installation of that application? or is there any other way to fix this issue.
Any help would be appreciated
推荐答案
WCF服务需要托管环境,必须单独托管在IIS,Windows服务中或至少作为控制台应用程序托管。除非您创建单独的托管平台,否则您的设置不会为您的WCF服务创建托管环境。
您可以考虑以下方式。
1.如果要将IIS托管,则可以为服务创建SVC文件,并修改SETUP以在IIS中安装WCF服务。或者,
2.您可以创建Windows服务,安装程序类并将WCF服务作为WINDOWS服务托管。
两点1 SETUP安装可以使用2和2,也可以使用点1或2,具体取决于您的环境。
希望这一点清除。
The WCF Service needs a hosting environment and must be hosted separately in IIS, Windows Service or at least as a console application. Your set up will not create a hosting environment for your WCF Service unless you create a separate hosting platform.
May be you can consider the following ways.
1. If you want to host it IIS, then you can create a SVC file for your service and modify your SETUP to install the WCF service in IIS. OR,
2. You can create a Windows Service, Installer classes and host the WCF service as a WINDOWS Service.
Both point 1 and 2 are possible with SETUP installation and whether to go with point 1 or 2, depends on your environment.
Hope this clears.
这篇关于通过安装Windows窗体应用程序的安装程序来托管WCF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文