B
Bishop
Any ideas on why I'm getting the error?
This subroutine works on my Vista workstation:
Sub DisplaySessionData()
Dim wmi, wql, instance, instances
wmi = GetObject("winmgmts:root/cimv2")
wql = "Select * from Win32_PerfRawData_ASPNET_ASPNET"
instances = wmi.ExecQuery(wql)
Response.Write("Count: " & instances.count & "<br />")
For Each instance In instances
Response.Write("Active Sessions: " &
instance.StateServerSessionsActive & " <br />")
Response.Write("Queued Requests: " & instance.RequestsQueued & "
<br />")
Response.Write("Current Requests: " & instance.RequestsCurrent &
" <br />")
Response.Write("Request Execution Time: " &
instance.RequestExecutionTime & " <br />")
Next
End Sub
When I upload to the Windows 2003 Server I get the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Invalid class
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Invalid
class
Source Error:
Line 21:
Line 22: instances = wmi.ExecQuery(wql)
Line 23: Response.Write("Count: " & instances.count & "<br />")
Line 24: For Each instance In instances
Line 25: Response.Write("Active Sessions: " &
instance.StateServerSessionsActive & " <br />")
Source File: c:\inetpub\serverinfo\Home.aspx.vb Line: 23
Stack Trace:
[COMException (0x80041010): Invalid class ]
Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type
objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack) +965
Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object
Instance, Type Type, String MemberName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +367036
Home.DisplaySessionData() in c:\inetpub\serverinfo\Home.aspx.vb:23
Home.Page_Load(Object sender, EventArgs e) in
c:\inetpub\serverinfo\Home.aspx.vb:13
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436
This subroutine works on my Vista workstation:
Sub DisplaySessionData()
Dim wmi, wql, instance, instances
wmi = GetObject("winmgmts:root/cimv2")
wql = "Select * from Win32_PerfRawData_ASPNET_ASPNET"
instances = wmi.ExecQuery(wql)
Response.Write("Count: " & instances.count & "<br />")
For Each instance In instances
Response.Write("Active Sessions: " &
instance.StateServerSessionsActive & " <br />")
Response.Write("Queued Requests: " & instance.RequestsQueued & "
<br />")
Response.Write("Current Requests: " & instance.RequestsCurrent &
" <br />")
Response.Write("Request Execution Time: " &
instance.RequestExecutionTime & " <br />")
Next
End Sub
When I upload to the Windows 2003 Server I get the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Invalid class
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Invalid
class
Source Error:
Line 21:
Line 22: instances = wmi.ExecQuery(wql)
Line 23: Response.Write("Count: " & instances.count & "<br />")
Line 24: For Each instance In instances
Line 25: Response.Write("Active Sessions: " &
instance.StateServerSessionsActive & " <br />")
Source File: c:\inetpub\serverinfo\Home.aspx.vb Line: 23
Stack Trace:
[COMException (0x80041010): Invalid class ]
Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type
objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack) +965
Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object
Instance, Type Type, String MemberName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +367036
Home.DisplaySessionData() in c:\inetpub\serverinfo\Home.aspx.vb:23
Home.Page_Load(Object sender, EventArgs e) in
c:\inetpub\serverinfo\Home.aspx.vb:13
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436