Host an Asp.Net 4.0 web application in IIS6 on Windows 2003 R2 SP2 x64.
C:\WINDOWS\microsoft.net\Framework
* 1.0.3705
* 1.1.4322
* 2.0.50727
* 3.0
* 3.5
* 4.0.30319
and in C:\WINDOWS\microsoft.net\Framework64 the same except 1.0 and 1.1
IIS6 runs in 32 bit mode but there is no Asp.Net tab in the properties screen of the website. So I can't switch frameworks and don't know what frameworks runs in what applicationpool.
Solutions :
Open command prompt on your Server.
Go to the default path of Asp.Net 4.0 i.e. C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319
run the command aspnet_regiis -lk | find "28008" (the number is the identifier of your web site )
Command: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspn et_regiis -lk | find "28008"
Once you run the command, you will get the current Asp.Net version which is set for your web site & i.e. W3SVC/28008/ROOT/ 2.0.50727.3053
Once it's done, you need to run the command aspnet_regiis.exe -norestart -s "W3SVC/28008/ROOT/" that will Start registering ASP.NET (4.0.30319) recursively at W3SVC/28008/ROOT/.
Command: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspn et_regiis.exe -norestart -s "W3SVC/28008/ROOT/"
It will finished registering ASP.NET (4.0.30319) recursively at W3SVC/28008/ROOT/. There is no need to restart IIS on server.
附:详细列出IIS里的站点ID、描述、及物理目录 VBScript Script 文件 (.vbs)
Set ObjService=GetObject("IIS://LocalHost/W3SVC")
For Each obj3w In objservice
If IsNumeric(obj3w.Name) Then
sServerName=Obj3w.ServerComment
Set webSite = GetObject("IIS://Localhost/W3SVC/" & obj3w.Name & "/Root")
ListAllWeb = ListAllWeb & obj3w.Name & String(25-Len(obj3w.Name)," ") & obj3w.ServerComment & "(" & webSite.Path & ")" & vbCrLf
End If
Next
WScript.Echo ListAllWeb
Set ObjService=Nothing
WScript.Quit
放在:C:\inetpub\AdminScripts\目录下。