Skip to content

Commit 24c159f

Browse files
authored
add sentry to global usings (#3043)
1 parent fbf8fac commit 24c159f

File tree

63 files changed

+18
-92
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+18
-92
lines changed

Diff for: CHANGELOG.md

+12

Diff for: benchmarks/Sentry.Benchmarks/LastActiveSpanBenchmarks.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using BenchmarkDotNet.Attributes;
2-
using Perfolizer.Mathematics.Randomization;
32

43
namespace Sentry.Benchmarks;
54

Diff for: benchmarks/Sentry.Benchmarks/StackFrameBenchmarks.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using BenchmarkDotNet.Attributes;
2-
using Sentry.Extensibility;
32

43
namespace Sentry.Benchmarks;
54

Diff for: samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Program.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Diagnostics;
22
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
3-
using Sentry;
43
using Sentry.Samples.AspNetCore.Blazor.Wasm;
54

65
// Capture blazor bootstrapping errors

Diff for: samples/Sentry.Samples.AspNetCore.Mvc/Controllers/HomeController.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Diagnostics;
22
using Microsoft.AspNetCore.Mvc;
33
using Samples.AspNetCore.Mvc.Models;
4-
using Sentry;
54

65
namespace Samples.AspNetCore.Mvc.Controllers;
76

Diff for: samples/Sentry.Samples.AspNetCore.Mvc/ExampleEventProcessor.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Sentry;
21
using Sentry.Extensibility;
32

43
namespace Samples.AspNetCore.Mvc;

Diff for: samples/Sentry.Samples.AspNetCore.Mvc/SpecialExceptionProcessor.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Sentry;
21
using Sentry.Extensibility;
32

43
namespace Samples.AspNetCore.Mvc;

Diff for: samples/Sentry.Samples.Console.Basic/Program.cs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
* For more advanced features of the SDK, see Sentry.Samples.Console.Customized.
99
*/
1010

11-
using Sentry;
12-
1311
// Initialize the Sentry SDK. (It is not necessary to dispose it.)
1412
SentrySdk.Init(options =>
1513
{

Diff for: samples/Sentry.Samples.Console.Customized/Program.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Reflection;
21
using System.Xml.Xsl;
3-
using Sentry;
42
using Sentry.Extensibility;
53

64
internal static class Program

Diff for: samples/Sentry.Samples.Console.Metrics/Program.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Numerics;
2-
3-
namespace Sentry.Samples.Console.Metrics;
1+
namespace Sentry.Samples.Console.Metrics;
42

53
internal static class Program
64
{

Diff for: samples/Sentry.Samples.Console.Native/Program.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
22
* This sample demonstrates a native crash handling in a NativeAOT published application.
33
*/
4-
using Sentry;
54

65
// Initialize the Sentry SDK. (It is not necessary to dispose it.)
76
SentrySdk.Init(options =>

Diff for: samples/Sentry.Samples.Console.Profiling/Program.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Diagnostics;
2-
using Sentry;
32
using Sentry.Profiling;
43

54
internal static class Program

Diff for: samples/Sentry.Samples.EntityFramework/Program.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.ComponentModel.DataAnnotations;
22
using System.Data.Common;
33
using System.Data.Entity;
4-
using Sentry;
54

65
using var _ = SentrySdk.Init(o =>
76
{

Diff for: samples/Sentry.Samples.GenericHost/SampleHostedService.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Microsoft.Extensions.Hosting;
22
using Microsoft.Extensions.Logging;
3-
using Sentry;
43

54
internal class SampleHostedService : IHostedService
65
{

Diff for: samples/Sentry.Samples.GraphQL.Client.Http/Program.cs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using GraphQL;
99
using GraphQL.Client.Http;
1010
using GraphQL.Client.Serializer.SystemTextJson;
11-
using Sentry;
1211

1312
SentrySdk.Init(options =>
1413
{

Diff for: samples/Sentry.Samples.GraphQL.Server/Notes/NotesData.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System.Collections.Concurrent;
2-
31
namespace Sentry.Samples.GraphQL.Server.Notes;
42

53
public class NotesData

Diff for: samples/Sentry.Samples.OpenTelemetry.Console/Program.cs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using OpenTelemetry;
99
using OpenTelemetry.Resources;
1010
using OpenTelemetry.Trace;
11-
using Sentry;
1211
using Sentry.OpenTelemetry;
1312

1413
var serviceName = "Sentry.Samples.OpenTelemetry.Console";

Diff for: src/Sentry.AspNet/SentryHttpServerUtilityExtensions.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Sentry.Extensibility;
2-
using Sentry.Protocol;
32

43
namespace Sentry.AspNet;
54

Diff for: src/Sentry.AspNetCore/BindableSentryAspNetCoreOptions.cs

-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
using Microsoft.AspNetCore.Hosting;
2-
using Microsoft.AspNetCore.Http;
31
using Sentry.Extensibility;
42
using Sentry.Extensions.Logging;
53

64
#if NETSTANDARD2_0
75
using IWebHostEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment;
8-
#else
9-
using Microsoft.Extensions.Hosting;
106
#endif
117

128
namespace Sentry.AspNetCore;

Diff for: src/Sentry.AspNetCore/SentryAspNetCoreOptionsSetup.cs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
using Microsoft.Extensions.Options;
44
using Sentry.Extensions.Logging;
55

6-
using IHostingEnvironment = Microsoft.AspNetCore.Hosting.IWebHostEnvironment;
7-
86
namespace Sentry.AspNetCore;
97

108
/// <summary>

Diff for: src/Sentry.AspNetCore/SentryTracingBuilder.cs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Microsoft.AspNetCore.Http;
33
using Microsoft.AspNetCore.Http.Features;
44
using Microsoft.Extensions.DependencyInjection;
5-
using Microsoft.Extensions.Logging;
65
using Microsoft.Extensions.Options;
76

87
namespace Sentry.AspNetCore;

Diff for: src/Sentry.AspNetCore/SentryTracingMiddlewareExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using Microsoft.Extensions.DependencyInjection;
22
using Microsoft.Extensions.Logging;
3-
using Sentry;
43
using Sentry.AspNetCore;
5-
using Sentry.Extensibility;
64
using Sentry.Internal.Extensions;
75

86
// ReSharper disable once CheckNamespace

Diff for: src/Sentry.AspNetCore/SentryWebHostBuilderExtensions.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Microsoft.AspNetCore.Builder;
2-
using Microsoft.Extensions.Configuration;
32
using Microsoft.Extensions.DependencyInjection;
43
using Microsoft.Extensions.Logging;
54
using Microsoft.Extensions.Logging.Configuration;

Diff for: src/Sentry.Azure.Functions.Worker/SentryFunctionsWorkerMiddleware.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Microsoft.Azure.Functions.Worker;
2-
using Microsoft.Azure.Functions.Worker.Http;
32
using Microsoft.Azure.Functions.Worker.Middleware;
43
using Sentry.Extensibility;
54
using Sentry.Internal;

Diff for: src/Sentry.DiagnosticSource/Internal/DiagnosticSource/EFConnectionDiagnosticSourceHelper.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Sentry.Extensibility;
2-
using Sentry.Internal.Extensions;
32

43
namespace Sentry.Internal.DiagnosticSource;
54

Diff for: src/Sentry.Maui/SentryMauiAppBuilderExtensions.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Microsoft.Extensions.Configuration;
21
using Microsoft.Extensions.DependencyInjection.Extensions;
32
using Microsoft.Extensions.Logging;
43
using Microsoft.Extensions.Options;

Diff for: src/Sentry.Profiling/Downsampler.cs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using Microsoft.Diagnostics.Tracing;
2-
using Microsoft.Diagnostics.Tracing.EventPipe;
3-
41
/// <summary>
52
/// Reduce sampling rate from 1 Hz that is the default for the provider to the configured SamplingRateMs.
63
/// </summary>

Diff for: src/Sentry.Profiling/SampleProfileBuilder.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Microsoft.Diagnostics.Tracing;
22
using Microsoft.Diagnostics.Tracing.Etlx;
33
using Sentry.Extensibility;
4-
using Sentry.Internal;
54
using Sentry.Protocol;
65

76
namespace Sentry.Profiling;

Diff for: src/Sentry/Extensibility/HubAdapter.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Sentry.Infrastructure;
2-
using Sentry.Internal;
32

43
namespace Sentry.Extensibility;
54

Diff for: src/Sentry/Integrations/AppDomainUnhandledExceptionIntegration.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Sentry.Extensibility;
22
using Sentry.Internal;
3-
using Sentry.Protocol;
43

54
namespace Sentry.Integrations;
65

Diff for: src/Sentry/Integrations/UnobservedTaskExceptionIntegration.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Sentry.Internal;
2-
using Sentry.Protocol;
32

43
namespace Sentry.Integrations;
54

Diff for: src/Sentry/Internal/Extensions/PEReaderExtensions.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Sentry.Extensibility;
21
using Sentry.Protocol;
32

43
namespace Sentry.Internal.Extensions;

Diff for: src/Sentry/Internal/ITransactionProfiler.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using Sentry.Protocol;
2-
31
namespace Sentry.Internal;
42

53
/// <summary>

Diff for: src/Sentry/Internal/MainSentryEventProcessor.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Sentry.Extensibility;
2-
using Sentry.Internal.Extensions;
32
using Sentry.Reflection;
43

54
namespace Sentry.Internal;

Diff for: src/Sentry/Internal/NoOpTransaction.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using Sentry.Protocol;
2-
31
namespace Sentry.Internal;
42

53
/// <summary>

Diff for: src/Sentry/Internal/ScopeObserver.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Sentry.Extensibility;
21
using Sentry.Internal.Extensions;
32

43
namespace Sentry.Internal;

Diff for: src/Sentry/Internal/StackFrame.cs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using Sentry.Internal.Extensions;
2-
using Sentry.Extensibility;
3-
41
namespace Sentry.Internal;
52

63
/// <summary>

Diff for: src/Sentry/MetricAggregator.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using Sentry.Extensibility;
32
using Sentry.Internal;
43
using Sentry.Internal.Extensions;

Diff for: src/Sentry/PlatformAbstractions/RuntimeInfo.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
31
namespace Sentry.PlatformAbstractions;
42

53
// https://github.com/dotnet/corefx/issues/17452

Diff for: src/Sentry/Platforms/Android/SentrySdk.cs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using Sentry.Android;
44
using Sentry.Android.Callbacks;
55
using Sentry.Android.Extensions;
6-
using Sentry.Internal;
76
using Sentry.JavaSdk.Android.Core;
87

98
// Don't let the Sentry Android SDK auto-init, as we do that manually in SentrySdk.Init

Diff for: src/Sentry/Platforms/Cocoa/Facades/SerializableNSObject.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Sentry.Extensibility;
2-
using Sentry.Internal;
32

43
namespace Sentry.Cocoa.Facades;
54

Diff for: src/Sentry/Platforms/Native/NativeScopeObserver.cs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using System;
2-
using System.Runtime.InteropServices;
3-
using Sentry.Extensibility;
41
using Sentry.Internal;
52

63
namespace Sentry.Native;

Diff for: src/Sentry/Protocol/ProfileInfo.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Sentry.Extensibility;
2-
using Sentry.Internal;
32
using Sentry.Internal.Extensions;
43

54
namespace Sentry.Protocol;

Diff for: src/Sentry/Protocol/SampleProfile.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Sentry.Extensibility;
2-
using Sentry.Internal;
32
using Sentry.Internal.Extensions;
43

54
#if NETFRAMEWORK

Diff for: src/Sentry/Scope.cs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
using Sentry.Extensibility;
2-
using Sentry.Internal;
32
using Sentry.Internal.Extensions;
4-
using Sentry.Internal.OpenTelemetry;
5-
using Sentry.Protocol;
63

74
namespace Sentry;
85

Diff for: src/Sentry/SentryEvent.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Sentry.Extensibility;
22
using Sentry.Integrations;
3-
using Sentry.Internal;
43
using Sentry.Internal.Extensions;
54
using Sentry.Protocol;
65

Diff for: src/Sentry/SentryHttpFailedRequestHandler.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Sentry.Internal;
21
using Sentry.Protocol;
32

43
namespace Sentry;

Diff for: src/Sentry/SentryHttpMessageHandler.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using Sentry.Extensibility;
2-
using Sentry.Internal;
3-
using Sentry.Internal.Extensions;
42
using Sentry.Internal.OpenTelemetry;
53

64
namespace Sentry;

Diff for: src/Sentry/SentryMessageHandler.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using Sentry.Extensibility;
2-
using Sentry.Internal;
32
using Sentry.Internal.Extensions;
4-
using Sentry.Internal.OpenTelemetry;
53

64
namespace Sentry;
75

Diff for: src/Sentry/TransactionTracer.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Sentry.Extensibility;
22
using Sentry.Internal;
3-
using Sentry.Internal.ScopeStack;
43
using Sentry.Protocol;
54

65
namespace Sentry;

Diff for: src/Sentry/buildTransitive/Sentry.targets

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33

4+
<ItemGroup Condition="$(Language) == 'C#' and $(SentryImplicitUsings) != 'false' and ($(ImplicitUsings) == 'enable' or $(ImplicitUsings) == 'true')">
5+
<Using Include="Sentry" />
6+
</ItemGroup>
7+
48
<PropertyGroup>
59
<SentryAttributesFile>Sentry.Attributes$(MSBuildProjectExtension.Replace('proj', ''))</SentryAttributesFile>
610
</PropertyGroup>

Diff for: test/Sentry.AspNetCore.Tests/SentryMiddlewareTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Microsoft.AspNetCore.Http;
33
using Microsoft.AspNetCore.Http.Features;
44
using Microsoft.Extensions.Logging;
5-
using Sentry.AspNetCore.Extensions;
65

76
#if NETCOREAPP3_1_OR_GREATER
87
using IHostingEnvironment = Microsoft.AspNetCore.Hosting.IWebHostEnvironment;

Diff for: test/Sentry.DiagnosticSource.Tests/SentrySqlListenerTests.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using Microsoft.EntityFrameworkCore.Storage;
21
using Sentry.Internal.DiagnosticSource;
3-
using Sentry.Internal.Extensions;
42
using static Sentry.Internal.DiagnosticSource.SentrySqlListener;
53

64
namespace Sentry.DiagnosticSource.Tests;

Diff for: test/Sentry.Maui.Tests/MauiEventsBinderTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Microsoft.Extensions.Options;
21
using Sentry.Maui.Internal;
32

43
namespace Sentry.Maui.Tests;

Diff for: test/Sentry.Maui.Tests/SentryMauiScreenshotTests.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using Microsoft.Extensions.Options;
2-
using Sentry.Internal.Http;
3-
using Sentry.Maui.Internal;
42

53
namespace Sentry.Maui.Tests;
64

Diff for: test/Sentry.OpenTelemetry.Tests/SentrySpanProcessorTests.cs

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using OpenTelemetry;
2-
using OpenTelemetry.Trace;
31
using Sentry.Internal.OpenTelemetry;
4-
using Sentry.PlatformAbstractions;
52

63
namespace Sentry.OpenTelemetry.Tests;
74

0 commit comments

Comments
 (0)