将现有的Web服务扩展设置为“允许".使用WiX [英] Set existing Web Service Extension to "Allow" using WiX
本文介绍了将现有的Web服务扩展设置为“允许".使用WiX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在IIS管理器的Web服务扩展下,默认情况下ASP.NET v2.0.50727设置为禁止".我想在安装过程中将此设置为允许".
In IIS Manager under Web Service Extensions, ASP.NET v2.0.50727 is set to "Prohibited" by default. I would like to set this to Allow during the install.
我当前正在使用WiX版本2.
I am currently using WiX Version 2.
我尝试使用:
<Component Id="Allow_WebServiceExtension_ASP.NET_2.0" DiskId="1" Guid="02247363-E423-41E1-AC15-BEF589B65A4D">
<WebServiceExtension Id="WebServiceExtension_ASP.NET_2.0" Allow="yes" File="%SystemRoot%\Microsoft.NET\Framework\[DOTNETFRAMEWORKVER]\aspnet_isapi.dll" Description="ASP.NET v2.0.50727" UIDeletable="no" />
</Component>
这将添加第二个ASP.NET 2.0.50727条目,而不会启用第一个.
This adds a second ASP.NET 2.0.50727 entry and does not enable the first.
推荐答案
我最终将以下代码放入了自定义操作中:
I ended up putting the following code into a custom action:
Dim WebSvcObj As Object
Dim LocatorObj As Object = CreateObject("WbemScripting.SWbemLocator")
Dim ProviderObj As Object = LocatorObj.ConnectServer(".", "root/MicrosoftIISv2", "", "")
WebSvcObj = ProviderObj.get("IIsWebService='w3svc'")
WebSvcObj.EnableWebServiceExtension("ASP.NET v2.0.50727")
它可能并不漂亮,但确实可以工作.
It may not be pretty, but it does work.
这篇关于将现有的Web服务扩展设置为“允许".使用WiX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文