The spring conference circuit is finally over! After logging over 20,000 miles over the past month, I’m relieved to be writing this on the plane ride home, where I plan on staying put for at least 6 weeks or so.
I presented several sessions at WinDev 2002 in New Orleans this year. There were some oldies: Understanding XSLT, which I have presented quite a few times in the past, and some brand new talks such as WebForms Internals. The WebForms Internals talk provided me with an excuse to show off CLAW to yet another audience. The demo, however, required me to modify CLAW so that it works with ASP.NET code.
I spent the first couple of days at WinDev updating CLAW so that it works correctly inside the aspnet_wp.exe worker process. This proved to be rather painful for two reasons. The first was complications involved in recompiling CLAW itself, and the second involved complications involved in redefining weaves.
To understand why recompiling CLAW was painful, we need to understand how the CLR loads profilers. CLR profilers are loaded based on the presence of two environment variables: Cor_Enable_Profiling and COR_PROFILER. Cor_Enable_Profiling must be set to 0x01, and COR_PROFILER must be set to the CLSID of the COM object that contains the profiler’s implementation. When the CLR creates a new managed process, it looks for the presence of these environment variables. If they are set, it loads the designated profiler.
However, recompiling CLAW was painful because
Recompiling CLAW required rebooting IIS using the IISRESET command .to restart inetinfo.exe, and by extension, aspnet_wp.exe which is a child process of inetinfo.exe.