From ae056769b0b8d05e8d7bc79fc16a5a998805d124 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 16 Jul 2026 15:53:22 +1200 Subject: [PATCH] feat(dotnet): document sending attachments with transactions Adds a subsection to the .NET Attachments page explaining the new addToTransactions flag on SentryAttachment, with a C#/F# example. Co-Authored-By: Claude Opus 4.8 --- .../enriching-events/attachments/index.mdx | 6 +++++ .../attachment-add-to-transactions/dotnet.mdx | 26 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 platform-includes/enriching-events/attachment-add-to-transactions/dotnet.mdx diff --git a/docs/platforms/dotnet/common/enriching-events/attachments/index.mdx b/docs/platforms/dotnet/common/enriching-events/attachments/index.mdx index aec92bf591bff..46df1b203ae2f 100644 --- a/docs/platforms/dotnet/common/enriching-events/attachments/index.mdx +++ b/docs/platforms/dotnet/common/enriching-events/attachments/index.mdx @@ -77,6 +77,12 @@ Attachments are retained for 30 or 90 days, based on [your plan's data retention Learn more about how attachments impact your [quota](/pricing/quotas/). +### Sending Attachments with Transactions + +By default, scope attachments are only sent with error events, not with transactions. To also send an attachment with transactions, set `addToTransactions` to `true` when you create the `SentryAttachment`, then add it to the scope: + + + ### Access to Attachments To limit access to attachments, navigate to your organization's **General Settings**, then select the _Attachments Access_ dropdown to set appropriate access — any member of your organization, the organization billing owner, member, admin, manager, or owner. diff --git a/platform-includes/enriching-events/attachment-add-to-transactions/dotnet.mdx b/platform-includes/enriching-events/attachment-add-to-transactions/dotnet.mdx new file mode 100644 index 0000000000000..b5892dfc7f5b0 --- /dev/null +++ b/platform-includes/enriching-events/attachment-add-to-transactions/dotnet.mdx @@ -0,0 +1,26 @@ +```csharp +// Create an attachment that is also sent with transactions +var attachment = new SentryAttachment( + AttachmentType.Default, + new FileAttachmentContent("your/path/file.log"), + fileName: "file.log", + contentType: null, + addToTransactions: true); + +// Add it to the scope - it's now sent with both events and transactions +SentrySdk.ConfigureScope(scope => scope.AddAttachment(attachment)); +``` + +```fsharp +// Create an attachment that is also sent with transactions +let attachment = + SentryAttachment( + AttachmentType.Default, + FileAttachmentContent("your/path/file.log"), + "file.log", + null, + addToTransactions = true) + +// Add it to the scope - it's now sent with both events and transactions +SentrySdk.ConfigureScope(fun scope -> scope.AddAttachment(attachment)) +```