diff --git a/docs/platforms/dotnet/guides/aspnet/index.mdx b/docs/platforms/dotnet/guides/aspnet/index.mdx index 9dc391e97ef7b..66697bb427c4d 100644 --- a/docs/platforms/dotnet/guides/aspnet/index.mdx +++ b/docs/platforms/dotnet/guides/aspnet/index.mdx @@ -32,8 +32,6 @@ as well as your logs as breadcrumbs. The logging integrations also capture event ## Configure You configure the SDK in the `Global.asax.cs`: - - ```csharp using System; using System.Web; @@ -91,6 +89,26 @@ public class MvcApplication : HttpApplication } ``` +If you'd prefer not to hardcode your DSN in your source code, you can store it in your `Web.config` file: + +```xml {filename:Web.config} + + + + + +``` + +And then read it from `ConfigurationManager.AppSettings`: + +```csharp +using System.Configuration; + +// ... + +options.Dsn = ConfigurationManager.AppSettings["SentryDsn"]; +``` + ### Capturing the affected user When opting-in to [SendDefaultPii](#senddefaultpii), the SDK will automatically read the user from the request by inspecting `HttpContext.User`. Default claim values like `NameIdentifier` for the _Id_ will be used.