ANTS Performance Profiler 5 - IIS 5.1 ASP.NET Error
uchandrasekar
Posts: 4
Error while setting environment variables on user
RedGate.Profiler.Engine.Exceptions.CannotStartSessionException
at bJ.Launch()
at RedGate.Profiler.Session.ProfilerSession.j()
Caused by:
Error while setting environment variables on user
RedGate.Profiler.Engine.Exceptions.CannotStartIisSessionException
at bQ.PerformLaunch()
at bJ.Launch()
Caused by:
Error while setting environment variables on user
RedGate.Profiler.Engine.Startup.IIS.IISException
stack trace:
at bx.SetupEnvironment(String currentUserName, String subprocessVariableValue)
at bo.StartProfilingIIS(String currentUserName, String subprocessVariableValue)
at RedGate.Profiler.Engine.Startup.IIS.IISStarter`1.StartProfilingIIS(String currentUserName, String subprocessVariableValue)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at RedGate.Profiler.Engine.Startup.IIISActuator`1.StartProfilingIIS(String currentUserName, String subprocessVariableValue)
at bQ.PerformLaunch()
Caused by:
Failed to get user profile
RedGate.Profiler.Engine.Startup.IIS.IISException
at bx.a(String , String , String )
at bx.SetupEnvironment(String currentUserName, String subprocessVariableValue)
RedGate.Profiler.Engine.Exceptions.CannotStartSessionException
at bJ.Launch()
at RedGate.Profiler.Session.ProfilerSession.j()
Caused by:
Error while setting environment variables on user
RedGate.Profiler.Engine.Exceptions.CannotStartIisSessionException
at bQ.PerformLaunch()
at bJ.Launch()
Caused by:
Error while setting environment variables on user
RedGate.Profiler.Engine.Startup.IIS.IISException
stack trace:
at bx.SetupEnvironment(String currentUserName, String subprocessVariableValue)
at bo.StartProfilingIIS(String currentUserName, String subprocessVariableValue)
at RedGate.Profiler.Engine.Startup.IIS.IISStarter`1.StartProfilingIIS(String currentUserName, String subprocessVariableValue)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at RedGate.Profiler.Engine.Startup.IIISActuator`1.StartProfilingIIS(String currentUserName, String subprocessVariableValue)
at bQ.PerformLaunch()
Caused by:
Failed to get user profile
RedGate.Profiler.Engine.Startup.IIS.IISException
at bx.a(String , String , String )
at bx.SetupEnvironment(String currentUserName, String subprocessVariableValue)
Comments
Can you try checking your registry to see if the environment variable
COR_PROFILER is enabled for the ASPNET user?
First, try checking the default environment settings using regedit in
HKEY_USERS\.Default\Environment to see if COR_PROFILER is set.
Next, check to see if the ASPNET account has its' own environment settings.
I don't think it will unless it's logged in interactively. To check this,
you'd need the ASPNET account's SID, which you can get by saving the
following VB code to a file and running with cscript.exe:
Code:
'VBScript to Enumerate Accounts, and SID
On Error Resume Next
if Err <> 0 Then
set lasterr = CreateObject("WbemScripting.SWbemLastError")
Wscript.echo lasterr.Operation
End if
'Get the local machine name
set WshShell = WScript.CreateObject("WScript.Shell")
SET WshEnv=WshShell.Environment("PROCESS")
Dim Machinename
Machinename=WshEnv("COMPUTERNAME")
set objWMIService = GetObject("Winmgmts:\\" & Machinename)
set colAccounts = objWMIService.InstancesOf("win32_Account")
For each objAccount In colAccounts
If objAccount.name="ASPNET" AND objAccount.Domain=Machinename Then
WScript.echo "Name " & objAccount.name & vbCRLf & _
"SID : " & objAccount.SID & vbcrlf & _
"Sid Type : " & objAccount.SIDType & vbcrlf & _
"Status : " & objAccount.Status & vbcrlf & _
"Domain : " & objAccount.Domain & vbcrlf & _
"Caption : " & objAccount.Caption
End if
Next
WScript.quit
Check HKEY_USERS\<SID>\Environment and see if COR_PROFILER appears in there.
When we need to profile services (such as IIS), we usually edit the service environment to contain the variables necessary to hook ANTS in. We added some code in a recent version that also changes the permissions on the temp directory to allow the UI and the service to read and write the same files (which is required for profiling), which has caused some issues for some people.
For IIS 5 we change the variables for the user that ASP.NET is running as, due to the different way it starts up.
It's usually not critical when the variables get left behind, as the core will disable itself if it's loaded into an application that doesn't need to be profiled.
When the Core DLL is installed, we register it with COM+, and we unregister it when the profiler is uninstalled.
Apart from that we don't make any changes to the system that could become permanent: for plain old desktop apps there's no need to change the registry to get the profiler to load in.
If this happens, a reboot may clear it up, but on the extreme end, you may have to delete ASPNET's profile and allow Windows to recreate it by accessing an ASP .NET application on the computer (outside of Profiler).