cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cascoli
Level 2

Can't enable ASP.NET web service extension in IIS 6.0

Hi folks,

I have an InstallShield project that needs to enable the ASP.NET v2.0 Web Service Extension in IIS 6.0 The code appropriately searched the list of extensions, finds ASP.NET v2.0.50727 and determines that it's not yet enabled. But when it attempts to run the simple vbscript style code to enable it, I get an error "The RPC server is unavailable". I've run relatively the same code in vbscript and it works fine...so i'm wondering if my syntax needs to be different when using InstallScript (InstallShield's coding language inside the project). I could farm this work out to a vbscript file outside of the project but would rather keep it inside since it's a relatively simple code of scripting (withstanding the fact that i can't get it to work!!! :mad: ). Here's what i have in InstallScript. The bolded line is where the error occurs. Any advice will be greatly appreciated. Thanks!

//////////////////////////////////////////////////////////////////////////
//
// Function: EnableAspNetWebExt
//
// Parameters:
//
// Purpose: This function will set ASP.NET web extension in IIS if not
// done already
//
//////////////////////////////////////////////////////////////////////////
function EnableAspNetWebExt()

BOOL bFound;
LIST listWebExts;
NUMBER n, nArrSize, nFound, nResult;
STRING sEnabled, sArrWebSvcExt();
OBJECT objIIS;

begin
//initialize array counter
n = 0;

//initialize boolean
bFound = FALSE;

//set object to root IIS properties
set objIIS = CoGetObject("IIS://localhost/W3SVC","");

if (IsObject(objIIS)) then

//build array with IIS Web Service Extension objects
sArrWebSvcExt = objIIS.Get("WebSvcExtRestrictionList");

//get size of array
nArrSize = SizeOf (sArrWebSvcExt);

//loop through array
while ((n < nArrSize) && (!bFound))

//search list for our web service extension
nFound = StrFind (sArrWebSvcExt(n), "ASP.NET v2.0.50727");
if (nFound >= 0) then

//found, now extract out 1st char (1 = enabled)
StrSub (sEnabled, sArrWebSvcExt(n), 0, 1);

if (sEnabled = "0") then

//not enabled yet, enable it
objIIS.EnableWebServiceExtension("ASP.NET v2.0.50727");
objIIS.SetInfo();
bFound = TRUE;

//debugging
Alert("IIS Web Service Extension ASP.NET v2.0.50727 currently disabled. Enabling now...", INFORMATION);

//write log entry
_WriteLog("IIS Web Service Extension ASP.NET v2.0.50727 currently disabled. Enabling now...");

elseif (sEnabled = "1") then
//already enabled
bFound = TRUE;

//debugging
Alert("IIS Web Service Extension ASP.NET v2.0.50727 already enabled. Nothing to do...", INFORMATION);

//write log entry
_WriteLog("IIS Web Service Extension ASP.NET v2.0.50727 already enabled. Nothing to do...");

else
//unknown return value

//throw error but don't abort installation
ERRMSG = "Unable to determine if IIS Web Service Extension ASP.NET v2.0.50727 is enabled. Please enable in IIS manually after installation is complete...";
ErrorHandler(ERRMSG, INFORMATION, FALSE);
endif;
endif;

//get next item in array
n = n + 1;
endwhile;
else
//display msg but don't abort installation
ERRMSG = "Unable to retrieve Web Service Extensions in IIS. Please verify ASP.NET v2.0.50727 Web Service Extension is enabled after the installation is complete...";
ErrorHandler(ERRMSG, INFORMATION, FALSE);
endif;
end;
Labels (1)
0 Kudos
(2) Replies
KrisVanherck
Level 6

sorry can't help you with the code, but i do believe you can do this using the "server configuration > Internet Information Services > Web Service Extensions" user interface

Add a web service extension with the asp.net properties and set it to enabled and overwrite
0 Kudos
ch_eng
Level 7

cascoli wrote:
Hi folks,

I have an InstallShield project that needs to enable the ASP.NET v2.0 Web Service Extension in IIS 6.0 ...


cascoli,

I realize this thread is nearly a year old and I hope you were able to find a solution for this problem. Your code worked great for me with minor modifications for an InstallScript MSI 2011 project checking for ASP.NET v4.0.30319 extensions. Just wanted to say "thanks"! Our installer runs with admin privileges - not sure if that makes a difference in this case.
0 Kudos