You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to affect only setups with generic host builder; with web host setting an empty string in appsettings.json works just fine.
In my setup the call is located within a IHostBuilder.ConfigureLogging, which suffers from this issue as it is similar to the sample above and thus most likely caused by same underlying reason.
My own research showed that dotnet/runtime#62532 and/or dotnet/runtime#65594 might be the root cause of this issue, as the .NET runtime seems to cast empty strings to null in some particular situations. If possible, it would be nice to have a way to prevent this from happening within the scope of the Sentry SDK.
Package
Sentry
.NET Flavor
.NET
.NET Version
9.0.0
OS
Android
SDK Version
9.0.101
Self-Hosted Sentry Version
No response
Steps to Reproduce
Run the
Sentry.Samples.GenericHost
project with"Dsn": ""
set inappsettings.json
Expected Result
The application to run with Sentry SDK disabled
Actual Result
System.ArgumentNullException: 'Value cannot be null. (Parameter 'You must supply a DSN to use Sentry.To disable Sentry, pass an empty string: "".See https://docs.sentry.io/platforms/dotnet/configuration/options/#dsn')'
Further details
This seems to affect only setups with generic host builder; with web host setting an empty string in
appsettings.json
works just fine.In my setup the call is located within a
IHostBuilder.ConfigureLogging
, which suffers from this issue as it is similar to the sample above and thus most likely caused by same underlying reason.My own research showed that dotnet/runtime#62532 and/or dotnet/runtime#65594 might be the root cause of this issue, as the .NET runtime seems to cast empty strings to null in some particular situations. If possible, it would be nice to have a way to prevent this from happening within the scope of the Sentry SDK.
Workaround
When manually setting the DSN with e.g.
the problem does not occur.
The text was updated successfully, but these errors were encountered: