2008-08-21 7 views

Antwort

6

@Chris schlug mich auf den Stempel auf dem ADSI Weg

du das aspnet_regiis.exe Werkzeug tun kann. Auf jeder Version von ASP.NET ist eines dieser Tools auf dem Computer installiert. Sie könnten berappen -

Dies konfiguriert ASP.NET 1,1

%windir%\microsoft.net\framework\v1.1.4322\aspnet_regiis -s W3SVC/[iisnumber]/ROOT 

Dies konfiguriert ASP.NET 2,0

%windir%\microsoft.net\framework\v2.0.50727\aspnet_regiis -s W3SVC/[iisnumber]/ROOT 

Sie wahrscheinlich schon wissen, aber wenn Sie mehrere 1.1 und 2.0 Websites auf Ihrem Computer, denken Sie daran, die Website, auf der Sie ASP.NET-Versionen ändern, auf den kompatiblen App-Pool umzustellen. ASP.NET 1.1- und 2.0-Websites werden nicht im selben App-Pool gemischt.

2

Ich fand das folgende Skript posted auf Diablo Pups Blog. Es verwendet ADSI-Automatisierung.

'****************************************************************************************** 
' Name: SetASPDotNetVersion 
' Description: Set the script mappings for the specified ASP.NET version 
' Inputs: objIIS, strNewVersion 
'****************************************************************************************** 
Sub SetASPDotNetVersion(objIIS, strNewVersion) 
Dim i, ScriptMaps, arrVersions(2), thisVersion, thisScriptMap 
Dim strSearchText, strReplaceText 

Select Case Trim(LCase(strNewVersion)) 
    Case "1.1" 
    strReplaceText = "v1.1.4322" 
    Case "2.0" 
    strReplaceText = "v2.0.50727" 
    Case Else 
    wscript.echo "WARNING: Non-supported ASP.NET version specified!" 
    Exit Sub 
End Select 

ScriptMaps = objIIS.ScriptMaps 
arrVersions(0) = "v1.1.4322" 
arrVersions(1) = "v2.0.50727" 
'Loop through all three potential old values 
For Each thisVersion in arrVersions 
    'Loop through all the mappings 
    For thisScriptMap = LBound(ScriptMaps) to UBound(ScriptMaps) 
    'Replace the old with the new 
    ScriptMaps(thisScriptMap) = Replace(ScriptMaps(thisScriptMap), thisVersion, strReplaceText) 
    Next 
Next 

objIIS.ScriptMaps = ScriptMaps 
objIIS.SetInfo 
wscript.echo "<-------Set ASP.NET version to " & strNewVersion & " successfully.------->" 
End Sub 
Verwandte Themen