Friend Of George
Friend Of George

Reputation: 488

Set existing Web Service Extension to "Allow" using WiX

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.

I am currently using WiX Version 2.

I have tried using:

<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>

This adds a second ASP.NET 2.0.50727 entry and does not enable the first.

Upvotes: 2

Views: 3377

Answers (4)

Bon
Bon

Reputation: 1

I modified the code to enable my .NET 4.0 Web Service Extension, using vbScript:

    Dim LocatorObj
    Dim WebSvcObj
    Dim ProviderObj

    Set LocatorObj = CreateObject("WbemScripting.SWbemLocator")
    Set ProviderObj = LocatorObj.ConnectServer(".", "root/MicrosoftIISv2", "", "")
    Set WebSvcObj = ProviderObj.get("IIsWebService='w3svc'")
    WebSvcObj.EnableWebServiceExtension("ASP.NET v4.0.30319")

Upvotes: 0

uli78
uli78

Reputation: 1025

I had the same problem using wix3. Since I haven’t found any other solution (??) I decided also to do it with a custom action. With the little difference that I use c# and the WMI support of the framework (System.Management). using WMI to configure IIS

OK I found out that I just had two misstakes in my Wix 1. the @Group was missing -> I set it to "ASP.NET v2.0.50727" 2. The path to the file was wrong. I had one backslash to much. After fixing these issues wix-iis:WebServiceExtension worked perfect for me.

Upvotes: 1

Friend Of George
Friend Of George

Reputation: 488

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.

Upvotes: 0

CheGueVerra
CheGueVerra

Reputation: 7963

Use the WebApplicationExtension Element in WIX, it's in the IISExtension, need to add the reference to the WIX project.

Upvotes: 0

Related Questions