关于 iis:当服务位于网站根目录时,如何在 AppFabric 中将 WCF 服务配置为自动启动

How to configure WCF Service to AutoStart in AppFabric when the services reside in the website root

我正在尝试在 WIndows Server 2008 R2 的 IIS 和 AppFabric 下配置我的 WCF 服务以自动启动,但 MSDN 中列出的步骤(此处:http://msdn.microsoft.com/en- us/library/ee677285(v=azure.10).aspx) 仅当服务驻留在应用程序中时才有可能,但在我的情况下,.svc 文件直接驻留在站点根目录中。

这样,\\'Configure WCF and WF...\\' 显示为 \\'...for Site\\' 并且不显示自动启动选项,如果应用程序托管在应用程序子文件夹。

有人知道我做错了什么吗?

提前致谢!


您必须编辑位于 C:\\\\\\\\windows\\\\\\\\system32\\\\\\\\inetsrv\\\\\\\\config\\\\\\\\applicationHost.config 的 IIS 配置文件
sample

或者最后使用 appcmd 脚本

1
appcmd.exe set config  -section:system.applicationHost/sites /[name='YourSite'].[path='/'].serviceAutoStartEnabled:"True" /[name='YourSite'].[path='/'].serviceAutoStartProvider:"Service" /[name='YourSite'].[path='/'].serviceAutoStartMode:"Custom"  /commit:apphost

这仅用于将 Web 应用程序配置为自动启动。对于每项服务,您将有其他步骤。