Exemple #1
0
    public void GetCurrent_GetEntryAssemblyNull_HttpApplicationAssembly()
    {
        var expected = ApplicationVersionLocator.GetCurrent(typeof(HttpApplication).Assembly);

        var actual = SystemWebVersionLocator.Resolve((string)null, Context);

        Assert.Equal(expected, actual);
    }
Exemple #2
0
    public void HttpApplicationAssembly_VersionParsing()
    {
        var expected = ApplicationVersionLocator.GetCurrent(typeof(HttpApplication).Assembly);

        var actual = SystemWebVersionLocator.Resolve(Context);

        Assert.Equal(expected, actual);
    }
        /// <summary>
        /// Adds ASP.NET classic integration.
        /// </summary>
        public static void AddAspNet(this SentryOptions options, RequestSize maxRequestBodySize = RequestSize.None)
        {
            var payloadExtractor = new RequestBodyExtractionDispatcher(
                new IRequestPayloadExtractor[] { new FormRequestPayloadExtractor(), new DefaultRequestPayloadExtractor() },
                options,
                () => maxRequestBodySize
                );

            var eventProcessor = new SystemWebRequestEventProcessor(payloadExtractor, options);

            options.Release ??= SystemWebVersionLocator.GetCurrent();
            options.AddEventProcessor(eventProcessor);
        }
Exemple #4
0
        /// <summary>
        /// Adds ASP.NET classic integration.
        /// </summary>
        public static void AddAspNet(this SentryOptions options, RequestSize maxRequestBodySize = RequestSize.None)
        {
            var payloadExtractor = new RequestBodyExtractionDispatcher(
                new IRequestPayloadExtractor[] { new FormRequestPayloadExtractor(), new DefaultRequestPayloadExtractor() },
                options,
                () => maxRequestBodySize);

            var eventProcessor = new SystemWebRequestEventProcessor(payloadExtractor, options);

            // Ignore options.IsGlobalModeEnable, we always want to use HttpContext as backing store here
            options.ScopeStackContainer ??= new HttpContextScopeStackContainer();

            options.DiagnosticLogger ??= new TraceDiagnosticLogger(options.DiagnosticLevel);
            options.Release ??= SystemWebVersionLocator.Resolve(options, HttpContext.Current);
            options.AddEventProcessor(eventProcessor);
            options.AddDiagnosticSourceIntegration();
        }