Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Refrain from adding Sentry to global usings #3109

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixes

- The SDK no longer adds `Sentry` to the global usings ([#3109](https://github.com/getsentry/sentry-dotnet/pull/3109))

### Dependencies

- Bump Cocoa SDK from v8.19.0 to v8.20.0 ([#3107](https://github.com/getsentry/sentry-dotnet/pull/3107))
Expand Down
1 change: 1 addition & 0 deletions samples/Sentry.Samples.AspNetCore.Blazor.Wasm/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Diagnostics;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Sentry;
using Sentry.Samples.AspNetCore.Blazor.Wasm;

// Capture blazor bootstrapping errors
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Data;
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using Sentry;
using Sentry.Samples.AspNetCore.Mvc.Models;

namespace Samples.AspNetCore.Mvc.Controllers;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Sentry;
using Sentry.Extensibility;

namespace Samples.AspNetCore.Mvc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Sentry;
using Sentry.Extensibility;

namespace Samples.AspNetCore.Mvc;
Expand Down
3 changes: 3 additions & 0 deletions samples/Sentry.Samples.Console.Basic/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/

// Initialize the Sentry SDK. (It is not necessary to dispose it.)

using Sentry;

SentrySdk.Init(options =>
{
// A Sentry Data Source Name (DSN) is required.
Expand Down
1 change: 1 addition & 0 deletions samples/Sentry.Samples.Console.Customized/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Xml.Xsl;
using Sentry;
using Sentry.Extensibility;

internal static class Program
Expand Down
3 changes: 3 additions & 0 deletions samples/Sentry.Samples.Console.Native/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
*/

// Initialize the Sentry SDK. (It is not necessary to dispose it.)

using Sentry;

SentrySdk.Init(options =>
{
// A Sentry Data Source Name (DSN) is required.
Expand Down
1 change: 1 addition & 0 deletions samples/Sentry.Samples.Console.Profiling/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using Sentry;
using Sentry.Profiling;

internal static class Program
Expand Down
1 change: 1 addition & 0 deletions samples/Sentry.Samples.EntityFramework/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.Data.Common;
using System.Data.Entity;
using Sentry;

using var _ = SentrySdk.Init(o =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Sentry;

internal class SampleHostedService : IHostedService
{
Expand Down
1 change: 1 addition & 0 deletions samples/Sentry.Samples.GraphQL.Client.Http/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using GraphQL;
using GraphQL.Client.Http;
using GraphQL.Client.Serializer.SystemTextJson;
using Sentry;

SentrySdk.Init(options =>
{
Expand Down
1 change: 1 addition & 0 deletions samples/Sentry.Samples.OpenTelemetry.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using OpenTelemetry;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using Sentry;
using Sentry.OpenTelemetry;

var serviceName = "Sentry.Samples.OpenTelemetry.Console";
Expand Down
4 changes: 0 additions & 4 deletions src/Sentry/buildTransitive/Sentry.targets
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<ItemGroup Condition="$(Language) == 'C#' and $(SentryImplicitUsings) != 'false' and ($(ImplicitUsings) == 'enable' or $(ImplicitUsings) == 'true')">
<Using Include="Sentry" />
</ItemGroup>

<PropertyGroup>
<SentryAttributesFile>Sentry.Attributes$(MSBuildProjectExtension.Replace('proj', ''))</SentryAttributesFile>
</PropertyGroup>
Expand Down
Loading