diff --git a/docs/platforms/dotnet/common/migration/index.mdx b/docs/platforms/dotnet/common/migration/index.mdx index 34a2d65f02689..61b3455539f1d 100644 --- a/docs/platforms/dotnet/common/migration/index.mdx +++ b/docs/platforms/dotnet/common/migration/index.mdx @@ -398,8 +398,6 @@ Changed how to initialize Sentry: ```csharp -using Sentry; - // Initialize with DSN SentrySdk.Init("___PUBLIC_DSN___"); @@ -414,7 +412,6 @@ For ASP.NET (classic) integration, add `Sentry.AspNet` package and initialize it ```csharp -using Sentry; using Sentry.AspNet; SentrySdk.Init(o => diff --git a/docs/platforms/dotnet/common/tracing/index.mdx b/docs/platforms/dotnet/common/tracing/index.mdx index d5ecc62de29b3..3e546f2bbeefb 100644 --- a/docs/platforms/dotnet/common/tracing/index.mdx +++ b/docs/platforms/dotnet/common/tracing/index.mdx @@ -22,8 +22,6 @@ First, enable tracing and configure the sample rate for transactions. Set the sa The two options are meant to be mutually exclusive. If you set both, will take precedence. ```csharp {diff} -using Sentry; - + // Add this to the SDK initialization callback + // Example uniform sample rate: capture 100% of transactions + options.TracesSampleRate = 1.0; diff --git a/docs/platforms/dotnet/common/user-feedback/index.mdx b/docs/platforms/dotnet/common/user-feedback/index.mdx index 0100239d85904..c3ee3df48b1c1 100644 --- a/docs/platforms/dotnet/common/user-feedback/index.mdx +++ b/docs/platforms/dotnet/common/user-feedback/index.mdx @@ -17,8 +17,6 @@ User Feedback for **[ASP.NET](/platforms/dotnet/guides/aspnet/user-feedback/#int You can create a form to collect the user input in your preferred framework, and use the SDK's API to send the information to Sentry. You can also use the widget, as described below. If you'd prefer an alternative to the widget or do not have a JavaScript frontend, you can use this API: ```csharp {tabTitle:C#} -using Sentry; - var eventId = SentrySdk.CaptureMessage("An event that will receive user feedback."); SentrySdk.CaptureUserFeedback(eventId, "user@example.com", "It broke.", "The User"); diff --git a/docs/platforms/dotnet/guides/aspnet/index.mdx b/docs/platforms/dotnet/guides/aspnet/index.mdx index f93a2b74e013c..68afbbb811d24 100644 --- a/docs/platforms/dotnet/guides/aspnet/index.mdx +++ b/docs/platforms/dotnet/guides/aspnet/index.mdx @@ -37,7 +37,6 @@ You configure the SDK in the `Global.asax.cs`: ```csharp {"onboardingOptions": {"performance": "21-24, 34-43"}} using System; using System.Web; -using Sentry; using Sentry.AspNet; using Sentry.EntityFramework; // If you also installed Sentry.EntityFramework using Sentry.Extensibility; diff --git a/docs/platforms/dotnet/guides/aspnet/tracing/included-instrumentation.mdx b/docs/platforms/dotnet/guides/aspnet/tracing/included-instrumentation.mdx index f24e3ddbfe10f..cfa08436a50d1 100644 --- a/docs/platforms/dotnet/guides/aspnet/tracing/included-instrumentation.mdx +++ b/docs/platforms/dotnet/guides/aspnet/tracing/included-instrumentation.mdx @@ -18,7 +18,6 @@ using System; using System.Configuration; using System.Web.Mvc; using System.Web.Routing; -using Sentry; using Sentry.AspNet; namespace AspNetMvc @@ -87,7 +86,6 @@ Transactions created by this integration are automatically added to the current ```csharp using System; using System.Web.Mvc; -using Sentry; public class HomeController : Controller { diff --git a/docs/platforms/dotnet/guides/aspnetcore/tracing/instrumentation/automatic-instrumentation.mdx b/docs/platforms/dotnet/guides/aspnetcore/tracing/instrumentation/automatic-instrumentation.mdx index d20538d4508a3..92bf14b84a9e4 100644 --- a/docs/platforms/dotnet/guides/aspnetcore/tracing/instrumentation/automatic-instrumentation.mdx +++ b/docs/platforms/dotnet/guides/aspnetcore/tracing/instrumentation/automatic-instrumentation.mdx @@ -32,7 +32,6 @@ Transactions created by this integration are automatically added to the current ```csharp using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; -using Sentry; public class HomeController : Controller { diff --git a/docs/platforms/dotnet/guides/entityframework/index.mdx b/docs/platforms/dotnet/guides/entityframework/index.mdx index 7f816b7dd6833..c461d2c19e385 100644 --- a/docs/platforms/dotnet/guides/entityframework/index.mdx +++ b/docs/platforms/dotnet/guides/entityframework/index.mdx @@ -48,7 +48,6 @@ For example, configuring an ASP.NET app with _global.asax_: ```csharp {filename:global.asax} {"onboardingOptions": {"performance": "16-18, 27-36"}} using System; using System.Configuration; -using Sentry; using Sentry.AspNet; public class MvcApplication : System.Web.HttpApplication diff --git a/docs/platforms/dotnet/guides/uwp/index.mdx b/docs/platforms/dotnet/guides/uwp/index.mdx index 2deb090284fc3..ac0b502fad23a 100644 --- a/docs/platforms/dotnet/guides/uwp/index.mdx +++ b/docs/platforms/dotnet/guides/uwp/index.mdx @@ -29,7 +29,6 @@ The SDK should be initialized in the constructor of your application class (usua ```csharp {"onboardingOptions": {"performance": "18-21"}} -using Sentry; using Sentry.Protocol; using UnhandledExceptionEventArgs = Windows.UI.Xaml.UnhandledExceptionEventArgs; diff --git a/docs/platforms/dotnet/guides/winforms/index.mdx b/docs/platforms/dotnet/guides/winforms/index.mdx index 86420eb403a96..1bd099b62fe3d 100644 --- a/docs/platforms/dotnet/guides/winforms/index.mdx +++ b/docs/platforms/dotnet/guides/winforms/index.mdx @@ -33,7 +33,6 @@ A complete example of the recommended startup is as follows: ```csharp {"onboardingOptions": {"performance": "32-35"}} using System; using System.Windows.Forms; -using Sentry; namespace WindowsFormsApp1 { diff --git a/docs/platforms/dotnet/guides/winui/index.mdx b/docs/platforms/dotnet/guides/winui/index.mdx index 5d2b60a719d7e..f204fe0097973 100644 --- a/docs/platforms/dotnet/guides/winui/index.mdx +++ b/docs/platforms/dotnet/guides/winui/index.mdx @@ -35,7 +35,6 @@ Select which Sentry features you'd like to install in addition to Error Monitori ```csharp {"onboardingOptions": {"performance": "17-20"}} -using Sentry; using Sentry.Protocol; sealed partial class App : Application @@ -82,7 +81,6 @@ Do not initialize the SDK in the `OnLaunched` event of the application or the `H ```csharp // Add these to your existing using statements. -using Sentry; using Sentry.Protocol; using UnhandledExceptionEventArgs = Microsoft.UI.Xaml.UnhandledExceptionEventArgs; diff --git a/docs/platforms/unity/user-feedback/index.mdx b/docs/platforms/unity/user-feedback/index.mdx index be0df50a5f774..e9fc782b8c0eb 100644 --- a/docs/platforms/unity/user-feedback/index.mdx +++ b/docs/platforms/unity/user-feedback/index.mdx @@ -17,8 +17,6 @@ User Feedback for **[ASP.NET](/platforms/dotnet/guides/aspnet/user-feedback/#int You can create a form to collect the user input in your preferred framework, and use the SDK's API to send the information to Sentry. You can also use the widget, as described below. If you'd prefer an alternative to the widget or do not have a JavaScript frontend, you can use this API: ```csharp {tabTitle:C#} -using Sentry; - var eventId = SentrySdk.CaptureMessage("An event that will receive user feedback."); SentrySdk.CaptureUserFeedback(eventId, "user@example.com", "It broke.", "The User"); diff --git a/platform-includes/capture-error/dotnet.mdx b/platform-includes/capture-error/dotnet.mdx index 826ca5ec71c54..ecd15a9067573 100644 --- a/platform-includes/capture-error/dotnet.mdx +++ b/platform-includes/capture-error/dotnet.mdx @@ -1,8 +1,6 @@ In C# you can capture any exception object that you caught: ```csharp -using Sentry; - try { AFunctionThatMightFail(); diff --git a/platform-includes/capture-message/dotnet.mdx b/platform-includes/capture-message/dotnet.mdx index 71374067cd53a..1a3999acff642 100644 --- a/platform-includes/capture-message/dotnet.mdx +++ b/platform-includes/capture-message/dotnet.mdx @@ -1,11 +1,7 @@ ```csharp -using Sentry; - SentrySdk.CaptureMessage("Something went wrong"); ``` ```fsharp -open Sentry - SentrySdk.CaptureMessage("Something went wrong") ``` diff --git a/platform-includes/configuration/before-send-transaction/dotnet.mdx b/platform-includes/configuration/before-send-transaction/dotnet.mdx index bd9ab2cafead9..b76585ef2a028 100644 --- a/platform-includes/configuration/before-send-transaction/dotnet.mdx +++ b/platform-includes/configuration/before-send-transaction/dotnet.mdx @@ -1,8 +1,6 @@ A `Func` can be used to update the transaction or drop it by returning `null` before it gets sent to Sentry. For example: ```csharp -using Sentry; - // Add this to the SDK initialization callback options.SetBeforeSendTransaction((sentryTransaction, hint) => { @@ -14,4 +12,4 @@ options.SetBeforeSendTransaction((sentryTransaction, hint) => return sentryTransaction; }); -``` \ No newline at end of file +``` diff --git a/platform-includes/configuration/before-send-transaction/powershell.mdx b/platform-includes/configuration/before-send-transaction/powershell.mdx index 5edc3107d0f09..e31a3ff234982 100644 --- a/platform-includes/configuration/before-send-transaction/powershell.mdx +++ b/platform-includes/configuration/before-send-transaction/powershell.mdx @@ -7,7 +7,7 @@ Start-Sentry { # Add this to the SDK initialization callback $_.SetBeforeSendTransaction([System.Func[Sentry.SentryTransaction, Sentry.SentryTransaction]] { param([Sentry.SentryTransaction]$sentryTransaction) - + # Modify the transaction if ($sentryTransaction.Operation -eq 'http.server') { @@ -20,9 +20,6 @@ Start-Sentry { ``` ```csharp -using Sentry; - - options.SetBeforeSendTransaction((sentryTransaction, hint) => { }); diff --git a/platform-includes/configuration/before-send/dotnet.mdx b/platform-includes/configuration/before-send/dotnet.mdx index fb320328d5eaa..8b866eeb8bb9e 100644 --- a/platform-includes/configuration/before-send/dotnet.mdx +++ b/platform-includes/configuration/before-send/dotnet.mdx @@ -1,8 +1,6 @@ A `Func` can be used to mutate, discard (return null), or return a completely new event. ```csharp -using Sentry; - // Add this to the SDK initialization callback options.SetBeforeSend((sentryEvent, hint) => { diff --git a/platform-includes/configuration/config-intro/dotnet.mdx b/platform-includes/configuration/config-intro/dotnet.mdx index 278a0942e3caf..20d395f77e6a9 100644 --- a/platform-includes/configuration/config-intro/dotnet.mdx +++ b/platform-includes/configuration/config-intro/dotnet.mdx @@ -2,8 +2,6 @@ For example, initialize with `SentrySdk.Init` in your `Program.cs` file: ```csharp -using Sentry; - SentrySdk.Init(options => { // A Sentry Data Source Name (DSN) is required. diff --git a/platform-includes/configuration/config-intro/dotnet.xamarin.mdx b/platform-includes/configuration/config-intro/dotnet.xamarin.mdx index 5d163c086343a..1a33c8b7deb94 100644 --- a/platform-includes/configuration/config-intro/dotnet.xamarin.mdx +++ b/platform-includes/configuration/config-intro/dotnet.xamarin.mdx @@ -3,8 +3,6 @@ pass the option object along for modifications: ```csharp -using Sentry; - SentryXamarin.Init(o => { o.Dsn = "___PUBLIC_DSN___"; diff --git a/platform-includes/configuration/sample-rate/dotnet.mdx b/platform-includes/configuration/sample-rate/dotnet.mdx index 22dc632e2a9c9..513e0e52c4676 100644 --- a/platform-includes/configuration/sample-rate/dotnet.mdx +++ b/platform-includes/configuration/sample-rate/dotnet.mdx @@ -1,13 +1,9 @@ ```csharp -using Sentry; - // Add this to the SDK initialization callback options.SampleRate = 0.25; ``` ```fsharp -open Sentry - // Add this to the SDK initialization callback options.SampleRate <- 0.25 // Capture 25% ``` diff --git a/platform-includes/distributed-tracing/custom-instrumentation/dotnet.mdx b/platform-includes/distributed-tracing/custom-instrumentation/dotnet.mdx index 560378cef4767..57ce0497035e7 100644 --- a/platform-includes/distributed-tracing/custom-instrumentation/dotnet.mdx +++ b/platform-includes/distributed-tracing/custom-instrumentation/dotnet.mdx @@ -12,7 +12,6 @@ Here's an example using RabbitMQ of how to extract and store incoming tracing in using System.Text; using RabbitMQ.Client; using RabbitMQ.Client.Events; -using Sentry; var factory = new ConnectionFactory() { @@ -62,7 +61,6 @@ If you're not using the `SentryHttpMessageHandler`, you can generate this tracin ```csharp using RabbitMQ.Client; -using Sentry; var factory = new ConnectionFactory() { diff --git a/platform-includes/enriching-events/attachment-init-with-bytes/dotnet.mdx b/platform-includes/enriching-events/attachment-init-with-bytes/dotnet.mdx index fd34bd445f542..6e0d55dc7cc58 100644 --- a/platform-includes/enriching-events/attachment-init-with-bytes/dotnet.mdx +++ b/platform-includes/enriching-events/attachment-init-with-bytes/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { // Add an in-memory attachment to the current scope @@ -9,8 +7,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> // Add an in-memory attachment to the current scope diff --git a/platform-includes/enriching-events/attachment-init-with-path/dotnet.mdx b/platform-includes/enriching-events/attachment-init-with-path/dotnet.mdx index d28bff5ca16c9..489c0acc2dcfe 100644 --- a/platform-includes/enriching-events/attachment-init-with-path/dotnet.mdx +++ b/platform-includes/enriching-events/attachment-init-with-path/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { // Add a file attachment to the current scope @@ -9,8 +7,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> // Add a file attachment to the current scope diff --git a/platform-includes/enriching-events/attachment-init-with-path/unity.mdx b/platform-includes/enriching-events/attachment-init-with-path/unity.mdx index dcccc1c5e9ed7..cde9620a32662 100644 --- a/platform-includes/enriching-events/attachment-init-with-path/unity.mdx +++ b/platform-includes/enriching-events/attachment-init-with-path/unity.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.AddAttachment(Path.Combine(Application.persistentDataPath, "file.log")); diff --git a/platform-includes/enriching-events/attachment-max-size/dotnet.mdx b/platform-includes/enriching-events/attachment-max-size/dotnet.mdx index 300ba826b5ecd..4bb0d5b229455 100644 --- a/platform-includes/enriching-events/attachment-max-size/dotnet.mdx +++ b/platform-includes/enriching-events/attachment-max-size/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // Add this to the SDK initialization callback options.MaxAttachmentSize = 5 * 1024 * 1024; // 5 MiB ``` diff --git a/platform-includes/enriching-events/attachment-upload/dotnet.mdx b/platform-includes/enriching-events/attachment-upload/dotnet.mdx index d1c6a188f923a..2d9bcd01a9540 100644 --- a/platform-includes/enriching-events/attachment-upload/dotnet.mdx +++ b/platform-includes/enriching-events/attachment-upload/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // Global Scope SentrySdk.ConfigureScope(scope => { diff --git a/platform-includes/enriching-events/attachment-upload/unity.mdx b/platform-includes/enriching-events/attachment-upload/unity.mdx index 2be67ec606ef7..bf794aff0baa0 100644 --- a/platform-includes/enriching-events/attachment-upload/unity.mdx +++ b/platform-includes/enriching-events/attachment-upload/unity.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.AddAttachment(Path.Combine(Application.persistentDataPath, "file.log")); diff --git a/platform-includes/enriching-events/breadcrumbs/before-breadcrumb/dotnet.mdx b/platform-includes/enriching-events/breadcrumbs/before-breadcrumb/dotnet.mdx index 847d6b509eb7a..e2c2eaaf39fbc 100644 --- a/platform-includes/enriching-events/breadcrumbs/before-breadcrumb/dotnet.mdx +++ b/platform-includes/enriching-events/breadcrumbs/before-breadcrumb/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // Add this to the SDK initialization callback options.SetBeforeBreadcrumb(breadcrumb // Ignore breadcrumbs from Spammy logger @@ -10,8 +8,6 @@ options.SetBeforeBreadcrumb(breadcrumb ``` ```fsharp -open Sentry - // Add this to the SDK initialization callback options.SetBeforeBreadcrumb(fun breadcrumb -> // Ignore breadcrumbs from Spammy logger diff --git a/platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/dotnet.mdx b/platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/dotnet.mdx index 1d931cccf65d4..c914d199ebe4f 100644 --- a/platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/dotnet.mdx +++ b/platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.AddBreadcrumb( message: "Authenticated user " + user.Email, category: "auth", @@ -8,8 +6,6 @@ SentrySdk.AddBreadcrumb( ``` ```fsharp -open Sentry - SentrySdk.AddBreadcrumb( "Authenticated user " + user.Email, "auth", diff --git a/platform-includes/enriching-events/event-processors/dotnet.mdx b/platform-includes/enriching-events/event-processors/dotnet.mdx index b32a909798035..3b9c68ac64b06 100644 --- a/platform-includes/enriching-events/event-processors/dotnet.mdx +++ b/platform-includes/enriching-events/event-processors/dotnet.mdx @@ -3,7 +3,6 @@ You can create your own event processors by implementing the `ISentryEventProcessor` interface. You can also create custom processors for transactions by implementing the `ISentryTransactionProcessor`. ```csharp -using Sentry; using Sentry.Extensibility; public class CustomEventProcessor : ISentryEventProcessor diff --git a/platform-includes/enriching-events/scopes/configure-scope/dotnet.mdx b/platform-includes/enriching-events/scopes/configure-scope/dotnet.mdx index 35df8928af572..e4dae22941902 100644 --- a/platform-includes/enriching-events/scopes/configure-scope/dotnet.mdx +++ b/platform-includes/enriching-events/scopes/configure-scope/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.SetTag("my-tag", "my value"); diff --git a/platform-includes/enriching-events/scopes/scope-callback-param/dotnet.mdx b/platform-includes/enriching-events/scopes/scope-callback-param/dotnet.mdx index 882bca956956b..6d48a53d8054f 100644 --- a/platform-includes/enriching-events/scopes/scope-callback-param/dotnet.mdx +++ b/platform-includes/enriching-events/scopes/scope-callback-param/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // will be tagged with my-tag="my value" SentrySdk.CaptureException(new Exception("my error"), scope => { diff --git a/platform-includes/enriching-events/set-context/dotnet.mdx b/platform-includes/enriching-events/set-context/dotnet.mdx index 1057eb18cad1c..0a81c31706ab9 100644 --- a/platform-includes/enriching-events/set-context/dotnet.mdx +++ b/platform-includes/enriching-events/set-context/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.Contexts["character"] = new @@ -13,8 +11,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope(fun scope -> scope.Contexts["character"] <- {| Name = "Mighty Fighter" diff --git a/platform-includes/enriching-events/set-context/unity.mdx b/platform-includes/enriching-events/set-context/unity.mdx index ef5d3c816a4ec..89e7df6ff9654 100644 --- a/platform-includes/enriching-events/set-context/unity.mdx +++ b/platform-includes/enriching-events/set-context/unity.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - class PlayerCharacter { public string Name { get; set; } diff --git a/platform-includes/enriching-events/set-tag/dotnet.mdx b/platform-includes/enriching-events/set-tag/dotnet.mdx index 7a4743ab643f7..a6a0aee438f10 100644 --- a/platform-includes/enriching-events/set-tag/dotnet.mdx +++ b/platform-includes/enriching-events/set-tag/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.SetTag("page.locale", "de-at"); @@ -8,8 +6,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope(fun scope -> scope.SetTag("page.locale", "de-at") ) diff --git a/platform-includes/enriching-events/set-tag/dotnet.nlog.mdx b/platform-includes/enriching-events/set-tag/dotnet.nlog.mdx index 09acba1e9a7ac..afcbda6bbf216 100644 --- a/platform-includes/enriching-events/set-tag/dotnet.nlog.mdx +++ b/platform-includes/enriching-events/set-tag/dotnet.nlog.mdx @@ -27,8 +27,6 @@ For more information on how to dynamically set event tags via `NLog.config`, see ``` ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { // You can still use NLog layouts in code to set configured propertes @@ -37,8 +35,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> // You can still use NLog layouts in code to set configured propertes diff --git a/platform-includes/enriching-events/set-transaction-name/dotnet.mdx b/platform-includes/enriching-events/set-transaction-name/dotnet.mdx index 289a7d429a952..c2d4148384925 100644 --- a/platform-includes/enriching-events/set-transaction-name/dotnet.mdx +++ b/platform-includes/enriching-events/set-transaction-name/dotnet.mdx @@ -1,5 +1,3 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => scope.TransactionName = "UserListViewModel"); ``` diff --git a/platform-includes/enriching-events/set-transaction-name/unity.mdx b/platform-includes/enriching-events/set-transaction-name/unity.mdx index 289a7d429a952..c2d4148384925 100644 --- a/platform-includes/enriching-events/set-transaction-name/unity.mdx +++ b/platform-includes/enriching-events/set-transaction-name/unity.mdx @@ -1,5 +1,3 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => scope.TransactionName = "UserListViewModel"); ``` diff --git a/platform-includes/enriching-events/set-user/dotnet.mdx b/platform-includes/enriching-events/set-user/dotnet.mdx index 4623d8acc4aa7..32c06fb570f07 100644 --- a/platform-includes/enriching-events/set-user/dotnet.mdx +++ b/platform-includes/enriching-events/set-user/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.User = new SentryUser @@ -11,8 +9,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> scope.User <- SentryUser(Email = "john.doe@example.com") diff --git a/platform-includes/enriching-events/set-user/dotnet.nlog.mdx b/platform-includes/enriching-events/set-user/dotnet.nlog.mdx index 38fadff9ab0fe..76e2198ef9f9c 100644 --- a/platform-includes/enriching-events/set-user/dotnet.nlog.mdx +++ b/platform-includes/enriching-events/set-user/dotnet.nlog.mdx @@ -27,8 +27,6 @@ ``` ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.User = new User @@ -39,8 +37,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> scope.User <- User(Email = "john.doe@example.com") diff --git a/platform-includes/enriching-events/unset-user/dotnet.mdx b/platform-includes/enriching-events/unset-user/dotnet.mdx index cb6d3ba38fe7f..f572efa76eafc 100644 --- a/platform-includes/enriching-events/unset-user/dotnet.mdx +++ b/platform-includes/enriching-events/unset-user/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.User = new SentryUser(); @@ -8,8 +6,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> scope.User <- SentryUser() diff --git a/platform-includes/getting-started-config/dotnet.aspnet.mdx b/platform-includes/getting-started-config/dotnet.aspnet.mdx index d0b3fe3c2abe6..61b7db8ce1c45 100644 --- a/platform-includes/getting-started-config/dotnet.aspnet.mdx +++ b/platform-includes/getting-started-config/dotnet.aspnet.mdx @@ -5,7 +5,6 @@ using System; using System.Configuration; using System.Web.Mvc; using System.Web.Routing; -using Sentry; using Sentry.AspNet; namespace AspNetMvc diff --git a/platform-includes/getting-started-config/dotnet.mdx b/platform-includes/getting-started-config/dotnet.mdx index 278a0942e3caf..20d395f77e6a9 100644 --- a/platform-includes/getting-started-config/dotnet.mdx +++ b/platform-includes/getting-started-config/dotnet.mdx @@ -2,8 +2,6 @@ For example, initialize with `SentrySdk.Init` in your `Program.cs` file: ```csharp -using Sentry; - SentrySdk.Init(options => { // A Sentry Data Source Name (DSN) is required. diff --git a/platform-includes/getting-started-config/dotnet.xamarin.mdx b/platform-includes/getting-started-config/dotnet.xamarin.mdx index 85abdcfbdaf32..421c52829a366 100644 --- a/platform-includes/getting-started-config/dotnet.xamarin.mdx +++ b/platform-includes/getting-started-config/dotnet.xamarin.mdx @@ -3,8 +3,6 @@ on MainActivity for Android, and, the top of FinishedLaunching on AppDelegate fo ```csharp -using Sentry; - SentryXamarin.Init(o => { o.AddXamarinFormsIntegration(); diff --git a/platform-includes/getting-started-verify/dotnet.mdx b/platform-includes/getting-started-verify/dotnet.mdx index 9c8ed5aa4239b..8ade5cdefb075 100644 --- a/platform-includes/getting-started-verify/dotnet.mdx +++ b/platform-includes/getting-started-verify/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - try { throw null; @@ -12,8 +10,6 @@ catch (Exception ex) ``` ```fsharp -open Sentry - try raise <| NullReferenceException () with ex -> diff --git a/platform-includes/getting-started-verify/unity.mdx b/platform-includes/getting-started-verify/unity.mdx index f3988529f2911..57d3207165919 100644 --- a/platform-includes/getting-started-verify/unity.mdx +++ b/platform-includes/getting-started-verify/unity.mdx @@ -1,5 +1,4 @@ ```csharp -using Sentry; using UnityEngine; public class TestMonoBehaviour : MonoBehaviour diff --git a/platform-includes/performance/always-inherit-sampling-decision/dotnet.mdx b/platform-includes/performance/always-inherit-sampling-decision/dotnet.mdx index bfef261ea66ee..0df60911e8e66 100644 --- a/platform-includes/performance/always-inherit-sampling-decision/dotnet.mdx +++ b/platform-includes/performance/always-inherit-sampling-decision/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - sentryOptions.TracesSampler = context => { if (context.TransactionContext.IsParentSampled is true) diff --git a/platform-includes/performance/configure-sample-rate/dotnet.mdx b/platform-includes/performance/configure-sample-rate/dotnet.mdx index efba5b6984258..3be3d913a41b5 100644 --- a/platform-includes/performance/configure-sample-rate/dotnet.mdx +++ b/platform-includes/performance/configure-sample-rate/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // Add this to the SDK initialization callback // Example uniform sample rate: capture 100% of transactions options.TracesSampleRate = 1.0; diff --git a/platform-includes/performance/custom-sampling-context/dotnet.mdx b/platform-includes/performance/custom-sampling-context/dotnet.mdx index 1a17ee15919b3..262b06668a7aa 100644 --- a/platform-includes/performance/custom-sampling-context/dotnet.mdx +++ b/platform-includes/performance/custom-sampling-context/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // The following data will take part in the sampling decision var samplingContext = new Dictionary { diff --git a/platform-includes/performance/force-sampling-decision/dotnet.mdx b/platform-includes/performance/force-sampling-decision/dotnet.mdx index 9bbf25355a9e9..9da3c20ea4822 100644 --- a/platform-includes/performance/force-sampling-decision/dotnet.mdx +++ b/platform-includes/performance/force-sampling-decision/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // IsSampled -> true var transactionContext = new TransactionContext("GET /search", "http", true); diff --git a/platform-includes/performance/retrieve-transaction/dotnet.mdx b/platform-includes/performance/retrieve-transaction/dotnet.mdx index 50b4feed2090f..6ce6e8603e1b6 100644 --- a/platform-includes/performance/retrieve-transaction/dotnet.mdx +++ b/platform-includes/performance/retrieve-transaction/dotnet.mdx @@ -3,8 +3,6 @@ In cases where you want to attach Spans to an already ongoing Transaction you can use `SentrySdk.GetSpan()`. If there is a running Transaction or Span currently on the scope, this method will return a `SentryTransaction` or `Span`; otherwise, it returns `null`. ```csharp -using Sentry; - var span = SentrySdk.GetSpan(); if (span == null) diff --git a/platform-includes/performance/traces-sampler-as-sampler/dotnet.mdx b/platform-includes/performance/traces-sampler-as-sampler/dotnet.mdx index bda3a4e7bf44b..6fbca437e0677 100644 --- a/platform-includes/performance/traces-sampler-as-sampler/dotnet.mdx +++ b/platform-includes/performance/traces-sampler-as-sampler/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // Add this to the SDK initialization callback // To set a uniform sample rate options.TracesSampleRate = 1.0; diff --git a/platform-includes/sensitive-data/set-tag/dotnet.mdx b/platform-includes/sensitive-data/set-tag/dotnet.mdx index 75f9ba4dd4d3d..2ef168b1b15f2 100644 --- a/platform-includes/sensitive-data/set-tag/dotnet.mdx +++ b/platform-includes/sensitive-data/set-tag/dotnet.mdx @@ -1,7 +1,5 @@ ```csharp -using Sentry; - -DateTime date = new DateTime(1990,12,08); +var date = new DateTime(1990,12,08); SentrySdk.ConfigureScope(scope => { diff --git a/platform-includes/sensitive-data/set-user/dotnet.mdx b/platform-includes/sensitive-data/set-user/dotnet.mdx index 4bc868d1a150e..c0dcd522b4a61 100644 --- a/platform-includes/sensitive-data/set-user/dotnet.mdx +++ b/platform-includes/sensitive-data/set-user/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.User.Id = "user.id"; diff --git a/platform-includes/set-extra/dotnet.mdx b/platform-includes/set-extra/dotnet.mdx index 7d64025bea6ae..a721be5b156b6 100644 --- a/platform-includes/set-extra/dotnet.mdx +++ b/platform-includes/set-extra/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.SetExtra("character.name", "Mighty Fighter"); @@ -8,8 +6,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope(fun scope -> scope.SetExtra("character.name", "Mighty Fighter") ) diff --git a/platform-includes/set-level/dotnet.mdx b/platform-includes/set-level/dotnet.mdx index 628647d55cb59..717cbaaa0ae83 100644 --- a/platform-includes/set-level/dotnet.mdx +++ b/platform-includes/set-level/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.Level = SentryLevel.Warning; @@ -8,8 +6,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> scope.Level <- SentryLevel.Warning diff --git a/platform-includes/set-level/unity.mdx b/platform-includes/set-level/unity.mdx index 443cfd5f7203d..23b9e7661c9a3 100644 --- a/platform-includes/set-level/unity.mdx +++ b/platform-includes/set-level/unity.mdx @@ -1,5 +1,3 @@ ```csharp -using Sentry; - SentrySdk.CaptureException(new Exception(), s => s.Level = SentryLevel.Warning); ```