Beispiel #1
0
        private RootedObjects()
        {
            _handle = GCHandle.Alloc(this);
            Pointer = (IntPtr)_handle;

            // Increment active request count as soon as possible to prevent
            // shutdown of the appdomain while requests are in flight.  It
            // is decremented in Destroy().
            HttpRuntime.IncrementActivePipelineCount();

            // this is an instance field instead of a static field since ETW can be enabled at any time
            _activityIdTracingIsEnabled = ActivityIdHelper.Instance != null && AspNetEventSource.Instance.IsEnabled();
            if (_activityIdTracingIsEnabled)
            {
                _requestActivityId = ActivityIdHelper.UnsafeCreateNewActivityId();
            }
        }