Are you getting the following message when you really shouldn’t?
Begin Message:
IntelliTrace is not collecting data for this debugging session.
IntelliTrace is not collecting data for this debugging session.
The project type may not be supported or the process you are debugging may have been either attached to or launched with IntelliTrace disabled. Restarting the debugging session within Visual Studio may solve this. Please note that IntelliTrace is not supported when attaching to a process that is already running.
If you have selected a custom location for IntelliTrace recordings, please make sure it is writable by the process being debugged.
End Message
End Message
Did IntelliTrace high (the setting that includes events and call information) used to work correctly and now it doesn’t? Are you debugging a web application on Windows 7 sp1 under IIS? Then this may be the solution for you.
Go to the your Windows installation location (typically C:\Windows) and drill down into System32\inetsrv\config open the applicationHost.config file. Find the following section
Within this section you should see all of the application pools that are defined for your IIS instance. In my default installation of Windows 7 SP1 with Visual Studio 2010 I have the following:
<applicationPools>
<add name="DefaultAppPool" />
<add name="Classic .NET AppPool" managedPipelineMode="Classic" />
<add name="ASP.NET v4.0" managedRuntimeVersion="v4.0" />
<add name="ASP.NET v4.0 Classic" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" />
<applicationPoolDefaults>
<processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="false" />
applicationPoolDefaults>
applicationPools>
The culprit is the setProfileEnvironment attribute on the processModel element. The proccessModel can be configured for any individual application pool. That is what you need to do by adding it to the specific pool that your application uses. You then need to set the setProfileEnvironment to “true”. Once that has been changed the environment variables that IntelliTrace relies on will not only be configured but will also be loaded by the application pool on execution. To get mine to work I changed it to look like this:
<applicationPools>
<add name="DefaultAppPool" />
<add name="Classic .NET AppPool" managedPipelineMode="Classic" />
<add name="ASP.NET v4.0" managedRuntimeVersion="v4.0">
<processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="true" />
add>
<add name="ASP.NET v4.0 Classic" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" />
<applicationPoolDefaults>
<processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="false" />
applicationPoolDefaults>
applicationPools>
Once you have made that change reboot IIS. I like to use iisreset at the command line. After that you should be good to go and have the full event and call information available by using IntelliTrace.
Extra Info
So now the question is what’s up with setProfileEnvironment? This is a new attribute that was introduced to Windows 7 in Service Pack 1. As it turns out there are some applications that rely on certain environment variables to have certain values. For example, the value of the %TEMP% environment variable will change depending on if the default system environment variables are loaded or a specific user profile environment variables are loaded. In some cases %TEMP% may point to a location under the Windows directory and in other cases it may be under the user profile location (e.g. %userprofile%\AppData\Local\Temp). For IIS this is all dependent on the identity under which the application pool is configured (Network Service vs. custom identity).
In some situations that arise when using ASP Classic (yes, that’s ASP 3.0) coupled with an Access database (I remember well those days) having the %TEMP% location reside under the user profile causes things to break. So, the new attribute was introduced that will prevent the environment variables for the profile associated with the application pool account to load if setProfileEnvironment is set to “false”. This is the default configuration.
So, don’t try and use the same application pool, with a custom identity, for both an ASP classic application that leverages an Access database along with a .NET application in which you want to collect IntelliTrace logs. That’s not asking too much is it? J

0 comments:
Post a Comment