Giter Site home page Giter Site logo

getsentry / sentry-dotnet Goto Github PK

View Code? Open in Web Editor NEW
563.0 44.0 203.0 117.53 MB

Sentry SDK for .NET

Home Page: https://docs.sentry.io/platforms/dotnet

License: MIT License

PowerShell 1.33% Shell 0.17% C# 98.40% Batchfile 0.06% CMake 0.02% C 0.01% Java 0.01% HTML 0.01%
dotnet crash-reporting sentry tag-production performance-monitoring

sentry-dotnet's Introduction


Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us, check out our open positions.

Sentry SDK for .NET

build codecov Discord Chat

Integrations Downloads NuGet Stable NuGet Preview Documentation
Sentry Downloads NuGet NuGet Documentation
Sentry.AspNetCore Downloads NuGet NuGet Documentation
Sentry.AspNetCore.Grpc Downloads NuGet NuGet Documentation
Sentry.AspNet Downloads NuGet NuGet Documentation
Sentry.Azure.Functions.Worker Downloads NuGet NuGet Documentation
Sentry.DiagnosticSource Downloads NuGet NuGet Documentation
Sentry.EntityFramework Downloads NuGet NuGet Documentation
Sentry.Google.Cloud.Functions Downloads NuGet NuGet Documentation
Sentry.Hangfire Downloads NuGet NuGet Documentation
Sentry.Log4Net Downloads NuGet NuGet Documentation
Sentry.Maui Downloads NuGet NuGet Documentation
Sentry.NLog Downloads NuGet NuGet Documentation
Sentry.OpenTelemetry Downloads NuGet NuGet Documentation
Sentry.Profiling Downloads NuGet NuGet Documentation
Sentry.Serilog Downloads NuGet NuGet Documentation

More Sentry .NET Integrations

Sentry offers other integrations that are not part of this repository:

Looking for something else? Let us know by raising an issue.

Documentation

Each NuGet package in the table above has its custom view of the docs. Click on the badge to find the best documentation for your use case.

Sentry has extensive documentation for its SDKs on https://docs.sentry.io.

Samples

Consider taking a look at the samples directory for different types of apps and example usages of the SDK. Looking for a way to connect Aspire with Sentry? We've got a sample for that too!

Talks

Resources

Documentation Discussions Discord Chat Stack Overflow Twitter Follow

sentry-dotnet's People

Contributors

bitsandfoxes avatar bruno-garcia avatar chan18 avatar christopher-taormina-zocdoc avatar dependabot-preview[bot] avatar dependabot[bot] avatar getsentry-bot avatar giorgi avatar github-actions[bot] avatar jairbubbles avatar jamescrosswell avatar jimhume avatar josh-degraw avatar kanadaj avatar lucas-zimerman avatar mattjohnsonpint avatar mercinq avatar mitch528 avatar olsh avatar philipphofmann avatar purekrome avatar seanfeldman avatar semuserable avatar simoncropp avatar snakefoot avatar swatinem avatar thommadn avatar tyrrrz avatar vaind avatar xt0rted avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sentry-dotnet's Issues

Documentation issue - advise that assembly names that start with "Sentry" won't have their logger entries logged

For the Extenions.Logging implementation, it looks as though any assembly whose name starts with the word "Sentry" won't have their logged messages sent to sentry.io .

This cost me a few hours of frustration because I started a new project called "SentryLoggingTest" which logged nothing to sentry.io ! Took a lot of reading of source code to find out why!

I suggest the README.md file is updated to reflect this.

Event level ignored

NuGet package version: 0.0.1-preview1

When I manually capture an event like so:
SentrySdk.CaptureEvent(new SentryEvent() { Message = "GetRequest", Level = SentryLevel.Warning });

Sentry on-premise web (version 9.0.0) displays as an error, and has the following message:

Discarded invalid value for parameter 'level'
Name: level
Value: Warning

It looks like the level might be case sensitive?

Log4Net integration: SentrySdk.Init() don't work

Hello everyone,
I would like to use Sentry.Log4Net, but initialize the DSN and other options via SentrySdk. Unfortunately this does not work, although the manual says so (Source).

image

For this I use the example code for the Log4Net integration, which can be found here on GitHub (Source).

internal class Program
    {
        private static readonly ILog Log = LogManager.GetLogger(typeof(Program));
        
        private static void Main()
        {
            SentrySdk.Init(o =>
            {
                o.Dsn = new Dsn("DSN");
                o.Release = DateTime.Today.ToString("yyyy-MM-dd");
            });

            log4net.Config.XmlConfigurator.Configure();
            
            try
            {
                DoWork();
            }
            catch (Exception e)
            {
                e.Data.Add("details", "Do work always throws.");
                Log.Error("Error: with exception", e);
            }

            Console.WriteLine("program finished");
            Console.ReadLine();
        }

        private static void DoWork()
        {
            Log.InfoFormat("InfoFormat: About to throw {0} type of exception.", nameof(NotImplementedException));
            throw new NotImplementedException();
        }
    }

Is this a bug or did I miss something?
Kind regards

Failure to capture event: System.ObjectDisposedException: Cannot access a disposed object.

Hi I tried sentry in my asp.net core app. When I turn on Debug mode I can see this exception:

Sentry.ISentryClient[0]
      Failure to capture event: System.ObjectDisposedException: Cannot access a disposed object.
      Object name: 'SentryClient'.
         at Sentry.SentryClient.CaptureEvent(SentryEvent event, Scope scope) in C:\projects\sentry-dotnet\src\Sentry\SentryClient.cs:line 77
         at Sentry.Internal.Hub.CaptureEvent(SentryEvent evt, Scope scope) in C:\projects\sentry-dotnet\src\Sentry\Internal\Hub.cs:line 95
dbugdbug: Sentry.ISentryClient[0]
      Configuring the scope.
: Sentry.ISentryClient[0]
      Configuring the scope.
dbugfail: Sentry.ISentryClient[0]
      Configuring the scope.
: Sentry.ISentryClient[0]
      Failure to capture event: System.ObjectDisposedException: Cannot access a disposed object.
      Object name: 'SentryClient'.
         at Sentry.SentryClient.CaptureEvent(SentryEvent event, Scope scope) in C:\projects\sentry-dotnet\src\Sentry\SentryClient.cs:line 77
         at Sentry.Internal.Hub.CaptureEvent(SentryEvent evt, Scope scope) in C:\projects\sentry-dotnet\src\Sentry\Internal\Hub.cs:line 95

I dont think I have some special setup. Its dotnet core 2.1 web api with EF core and Autofac DI container.
Unfortunately I can post here whole project but if you need more info don't hesitate to ask.

Request: Populate basic user information

The previous C# SDK would automatically populate the Username, IP, etc. I see that we can manually add it using an event handler, but it would be useful to populate automatically if not provided.

Add general usage example in README

I know you link to examples but 90 percent of the time I just need to send an exception. Why do I need to dig through code for this use case? Your previous repo did a great job in displaying all what is needed to get started in the README.

Add opt-out flag for Cancellation events

In most cases, cancellation events are intentionally programmed events but are often handled by throwing a System.OperationCanceledException to interrupt the entire pipeline. As these are non-errors, it'd be nice to have in-built support for opting out of logging these.

On another note, there is a specific brand of ConnectionResetException which also happens when a user is disconnected from the server, i.e. they stop their browsers from loading, or their own connection is reset.

This specific case manifests in this form:

System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
  Module "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketAwaitable", in GetResult
  Module "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection", in ProcessReceives
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
  Module "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection", in DoReceive
Microsoft.AspNetCore.Connections.ConnectionResetException: An existing connection was forcibly closed by the remote host
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.IO.Pipelines.PipeCompletion", in ThrowLatchedException
  Module "System.IO.Pipelines.Pipe", in GetReadResult
  Module "System.IO.Pipelines.Pipe", in ReadAsync
  Module "System.IO.Pipelines.Pipe+DefaultPipeReader", in ReadAsync
  Module "Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1MessageBody", in PumpAsync
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.IO.Pipelines.PipeCompletion", in ThrowLatchedException
  Module "System.IO.Pipelines.Pipe", in GetReadResult
  Module "System.IO.Pipelines.Pipe", in ReadAsync
  Module "System.IO.Pipelines.Pipe+DefaultPipeReader", in ReadAsync
  Module "Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.MessageBody", in ReadAsync
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
  Module "Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestStream", in ReadAsyncInternal
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
  Module "Microsoft.AspNetCore.WebUtilities.FileBufferingReadStream", in ReadAsync
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
  Module "System.IO.StreamReader", in ReadBufferAsync
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
  Module "System.IO.StreamReader", in ReadAsyncInternal
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
  Module "Microsoft.AspNetCore.WebUtilities.FormReader", in BufferAsync
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
  Module "Microsoft.AspNetCore.WebUtilities.FormReader", in ReadNextPairAsyncImpl
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
  Module "Microsoft.AspNetCore.WebUtilities.FormReader", in ReadFormAsync
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
  Module "Microsoft.AspNetCore.Http.Features.FormFeature", in InnerReadFormAsync
  Module "System.Runtime.ExceptionServices.ExceptionDispatchInfo", in Throw
  Module "System.Runtime.CompilerServices.TaskAwaiter", in HandleNonSuccessAndDebuggerNotification
  Module "Microsoft.AspNetCore.Http.Features.FormFeature", in ReadForm
  Module "Sentry.AspNetCore.FormRequestPayloadExtractor", in DoExtractPayLoad
  Module "Sentry.AspNetCore.BaseRequestPayloadExtractor", in ExtractPayload
  Module "Sentry.AspNetCore.ScopeExtensions", in SetBody
  Module "Sentry.AspNetCore.ScopeExtensions", in Populate
  Module "Sentry.AspNetCore.SentryMiddleware", in PopulateScope
  Module "Sentry.Scope", in Evaluate

It might be worth considering an opt-out filter for these too, since they are mostly non-errors.

Events are not sent in AWS Lambda

I have discovered some issues when using SDK on AWS Lambda/API Gateway

The following message is logged to sentry

[HttpGet("/health")]
[ProducesResponseType((int) HttpStatusCode.OK)]
public async Task HealthCheck()
{
    _logger.LogCritical("test");
    await Task.Delay(TimeSpan.FromSeconds(10));
}

while this does not

[HttpGet("/health")]
[ProducesResponseType((int) HttpStatusCode.OK)]
public IActionResult HealthCheck()
{
    _logger.LogCritical("test");
    return Ok()
}

The problem might be related to aws/aws-lambda-dotnet#239. The thread is killed right after the response is sent.

Attach to global exception handler without wrapping in a using statement

Hey there. I'm trying to port my application from the old client to this one but I'm running into an issue. It's not really possible for me to be using the using keyword for calls that might have an exception, I don't have control of the event loop.

However I still like to record exceptions and messages. To test I used the following bit of code:

		Sentry.SentrySdk.Init("my-dsn");
		Sentry.SentrySdk.AddBreadcrumb("Started", "Resource start");
		Sentry.SentrySdk.AddBreadcrumb("Some failure", "Resource start failed", level: Sentry.Protocol.BreadcrumbLevel.Warning);
		Sentry.SentrySdk.CaptureMessage("Uh oh", Sentry.Protocol.SentryLevel.Warning);
		Sentry.SentryEvent logEvent = new Sentry.SentryEvent(new Exception("Error with questions"));
		logEvent.User.Username = "testing";
		logEvent.User.Id = "123";
		Sentry.SentrySdk.CaptureEvent(logEvent);

However nothing is sent to Sentry. Is there anyway to not use the using statement and instead make my own factory for the instance so it can be used in a similar manner to the old SDK?

If an exception happens in the application I would like Sentry to log it, even if it's uncaught in a using statement, but I can't seem to initialize it or keep the SDK created with my DSN so how would that be possible?

ArgumentNullException at Regex.Match while trying to capture exception

Hi,

I'm trying to test out Sentry with Xamarin Forms but I was not getting any logs back in Sentry from unhandled exceptions in my Xamarin Forms app. Capturing regular exceptions works fine (e.g. SentrySdk.CaptureException(new Exception("Testing"))

So I tried using my own UnhandledException handler but it seems like I'm getting an exception while trying to call SentrySdk.CaptureException(exception)? Which might be the original reason why I didn't get any unhandled exceptions via default Sentry handler (AppDomainUnhandledExceptionIntegration)

iOS unhandled exception code:

public class Application
    {
        // This is the main entry point of the application.
        static void Main(string[] args)
        {
            // if you want to use a different Application Delegate class from "AppDelegate"
            // you can specify it here.
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            UIApplication.Main(args, null, "AppDelegate");

        }

        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Console.WriteLine("Exception is unhandled");
            Exception exception = e.ExceptionObject as Exception;
            try
            {
                SentrySdk.CaptureException(exception); // This results in an ArgumentNullException
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex);
            }
        }

Exception I got from the try catch while trying to CaptureException:

2018-07-26 13:15:12.677512+0200 MyApp.iOS[42004:3175540] System.ArgumentNullException: Value cannot be null.
Parameter name: input
  at System.Text.RegularExpressions.Regex.Match (System.String input) [0x00003] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.99.1.44/src/Xamarin.iOS/mcs/class/referencesource/System/regex/system/text/regularexpressions/Regex.cs:862 
  at System.Text.RegularExpressions.Regex.Match (System.String input, System.String pattern, System.Text.RegularExpressions.RegexOptions options, System.TimeSpan matchTimeout) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.99.1.44/src/Xamarin.iOS/mcs/class/referencesource/System/regex/system/text/regularexpressions/Regex.cs:846 
  at System.Text.RegularExpressions.Regex.Match (System.String input, System.String pattern) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.99.1.44/src/Xamarin.iOS/mcs/class/referencesource/System/regex/system/text/regularexpressions/Regex.cs:822 
  at Sentry.Internal.MainExceptionProcessor.DemangleAnonymousFunction (Sentry.Protocol.SentryStackFrame frame) [0x00004] in C:\projects\sentry-dotnet\src\Sentry\Internal\MainExceptionProcessor.cs:218 
  at Sentry.Internal.MainExceptionProcessor.CreateSentryStackFrame (System.Diagnostics.StackFrame stackFrame) [0x000d7] in C:\projects\sentry-dotnet\src\Sentry\Internal\MainExceptionProcessor.cs:157 
  at System.Linq.Enumerable+SelectEnumerableIterator`2[TSource,TResult].ToList () [0x0001b] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.99.1.44/src/Xamarin.iOS/external/corefx/src/System.Linq/src/System/Linq/Select.cs:163 
  at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.99.1.44/src/Xamarin.iOS/external/corefx/src/System.Linq/src/System/Linq/ToCollection.cs:30 
  at Sentry.Internal.MainExceptionProcessor+<CreateSentryException>d__1.MoveNext () [0x00236] in C:\projects\sentry-dotnet\src\Sentry\Internal\MainExceptionProcessor.cs:85 
  at System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) [0x00077] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.99.1.44/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/collections/generic/list.cs:99 
  at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.99.1.44/src/Xamarin.iOS/external/corefx/src/System.Linq/src/System/Linq/ToCollection.cs:30 
  at Sentry.Internal.MainExceptionProcessor.Process (System.Exception exception, Sentry.SentryEvent sentryEvent) [0x00006] in C:\projects\sentry-dotnet\src\Sentry\Internal\MainExceptionProcessor.cs:22 
  at Sentry.Internal.MainSentryEventProcessor.Process (Sentry.SentryEvent event) [0x0010d] in C:\projects\sentry-dotnet\src\Sentry\Internal\MainSentryEventProcessor.cs:82 
  at Sentry.SentryClient.CaptureEvent (Sentry.SentryEvent event, Sentry.Protocol.Scope scope) [0x0004a] in C:\projects\sentry-dotnet\src\Sentry\SentryClient.cs:85 
  at Sentry.Internal.Hub.CaptureEvent (Sentry.SentryEvent evt, Sentry.Protocol.Scope scope) [0x00017] in C:\projects\sentry-dotnet\src\Sentry\Internal\Hub.cs:54 
  at Sentry.SentryClientExtensions.CaptureException (Sentry.ISentryClient client, System.Exception ex) [0x00000] in C:\projects\sentry-dotnet\src\Sentry\SentryClientExtensions.cs:21 
  at Sentry.SentrySdk.CaptureException (System.Exception exception) [0x00000] in C:\projects\sentry-dotnet\src\Sentry\SentrySdk.cs:258 
  at MyApp.iOS.Application.CurrentDomain_UnhandledException (System.Object sender, System.UnhandledExceptionEventArgs e) [0x00019] in /Users/vpl/Repos/MyApp-app/src/MyApp.iOS/Main.cs:26
2018-07-26 13:15:12.679037+0200 MyApp.iOS[42004:3175540] warning: exception inside UnhandledException handler: Value cannot be null.

Exception I was trying to capture:

2018-07-26 13:15:12.680053+0200 MyApp.iOS[42004:3175540] Unhandled managed exception:
Object reference not set to an instance of an object (System.NullReferenceException)
  at MyApp.SettingsViewModel.<.ctor>b__5_10 () [0x00001] in /Users/vpl/Repos/MyApp-app/src/MyApp.Shared/ViewModels/SettingsViewModel.cs:178 
  at Xamarin.Forms.Command+<>c__DisplayClass3_0.<.ctor>b__0 (System.Object o) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Command.cs:73 
  at Xamarin.Forms.Command.Execute (System.Object parameter) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Command.cs:107 
  at Xamarin.Forms.TextCell.OnTapped () [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\Cells\TextCell.cs:89 
  at Xamarin.Forms.TableView+TableSectionModel.OnRowSelected (System.Object item) [0x00007] in D:\a\1\s\Xamarin.Forms.Core\TableView.cs:212 
  at Xamarin.Forms.Internals.TableModel.RowSelected (System.Object item) [0x0001a] in D:\a\1\s\Xamarin.Forms.Core\TableModel.cs:68 
  at Xamarin.Forms.Internals.TableModel.RowSelected (System.Int32 section, System.Int32 row) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\TableModel.cs:60 
  at Xamarin.Forms.Platform.iOS.TableViewModelRenderer.RowSelected (UIKit.UITableView tableView, Foundation.NSIndexPath indexPath) [0x00017] in <2a59efab866341818ab4748ebe270f0a>:0 
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.99.1.44/src/Xamarin.iOS/UIKit/UIApplication.cs:79 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.99.1.44/src/Xamarin.iOS/UIKit/UIApplication.cs:63 
  at MyApp.iOS.Application.Main (System.String[] args) [0x00018] in /Users/vpl/Repos/MyApp-app/src/MyApp.iOS/Main.cs:16
2018-07-26 13:15:12.680325+0200 MyApp.iOS[42004:3175540] critical: Stacktrace:
2018-07-26 13:15:12.680415+0200 MyApp.iOS[42004:3175540] critical: 
Native stacktrace:
2018-07-26 13:15:12.688255+0200 MyApp.iOS[42004:3175540] critical: 	0   MyApp.iOS                            0x00000001022ad1d4 mono_handle_native_crash + 244
2018-07-26 13:15:12.688399+0200 MyApp.iOS[42004:3175540] critical: 	1   libsystem_platform.dylib            0x00000001126c9f5a _sigtramp + 26
2018-07-26 13:15:12.688504+0200 MyApp.iOS[42004:3175540] critical: 	2   ???                                 0x00000001029ec12c 0x0 + 4338925868
2018-07-26 13:15:12.688629+0200 MyApp.iOS[42004:3175540] critical: 	3   libsystem_c.dylib                   0x0000000112452b81 abort + 127
2018-07-26 13:15:12.688744+0200 MyApp.iOS[42004:3175540] critical: 	4   MyApp.iOS                            0x00000001024b667f xamarin_unhandled_exception_handler + 47
2018-07-26 13:15:12.688856+0200 MyApp.iOS[42004:3175540] critical: 	5   MyApp.iOS                            0x000000010233a434 mono_invoke_unhandled_exception_hook + 148
2018-07-26 13:15:12.688996+0200 MyApp.iOS[42004:3175540] critical: 	6   MyApp.iOS                            0x00000001022acc89 mono_handle_exception_internal + 6105
2018-07-26 13:15:12.689135+0200 MyApp.iOS[42004:3175540] critical: 	7   MyApp.iOS                            0x00000001022ab4a9 mono_handle_exception + 25
2018-07-26 13:15:12.689257+0200 MyApp.iOS[42004:3175540] critical: 	8   MyApp.iOS                            0x00000001022169df mono_amd64_throw_exception + 143
2018-07-26 13:15:12.689390+0200 MyApp.iOS[42004:3175540] critical: 	9   ???                                 0x000000013132a827 0x0 + 5120370727
2018-07-26 13:15:12.689499+0200 MyApp.iOS[42004:3175540] critical: 	10  MyApp.iOS                            0x00000001022bf6d3 mono_jit_runtime_invoke + 1443
2018-07-26 13:15:12.689648+0200 MyApp.iOS[42004:3175540] critical: 	11  MyApp.iOS                            0x000000010239e80f mono_runtime_invoke_checked + 127
2018-07-26 13:15:12.689774+0200 MyApp.iOS[42004:3175540] critical: 	12  MyApp.iOS                            0x00000001023a210c mono_runtime_invoke + 76
2018-07-26 13:15:12.689881+0200 MyApp.iOS[42004:3175540] critical: 	13  MyApp.iOS                            0x00000001024bfb0e xamarin_invoke_trampoline + 6046
2018-07-26 13:15:12.689979+0200 MyApp.iOS[42004:3175540] critical: 	14  MyApp.iOS                            0x00000001024c7fed xamarin_arch_trampoline + 189
2018-07-26 13:15:12.690087+0200 MyApp.iOS[42004:3175540] critical: 	15  MyApp.iOS                            0x00000001024c9421 xamarin_x86_64_common_trampoline + 110
2018-07-26 13:15:12.690183+0200 MyApp.iOS[42004:3175540] critical: 	16  UIKitCore                           0x000000011a4def71 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1813
2018-07-26 13:15:12.690292+0200 MyApp.iOS[42004:3175540] critical: 	17  UIKitCore                           0x000000011a4df18c -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 344
2018-07-26 13:15:12.690432+0200 MyApp.iOS[42004:3175540] critical: 	18  UIKitCore                           0x0000000119f9bdb5 _runAfterCACommitDeferredBlocks + 318
2018-07-26 13:15:12.690561+0200 MyApp.iOS[42004:3175540] critical: 	19  UIKitCore                           0x0000000119f8ac0b _cleanUpAfterCAFlushAndRunDeferredBlocks + 397
2018-07-26 13:15:12.690663+0200 MyApp.iOS[42004:3175540] critical: 	20  UIKitCore                           0x0000000119fba5e7 _afterCACommitHandler + 141
2018-07-26 13:15:12.690832+0200 MyApp.iOS[42004:3175540] critical: 	21  CoreFoundation                      0x0000000110094ea7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
2018-07-26 13:15:12.691011+0200 MyApp.iOS[42004:3175540] critical: 	22  CoreFoundation                      0x000000011008f2de __CFRunLoopDoObservers + 430
2018-07-26 13:15:12.691151+0200 MyApp.iOS[42004:3175540] critical: 	23  CoreFoundation                      0x000000011008f981 __CFRunLoopRun + 1553
2018-07-26 13:15:12.691304+0200 MyApp.iOS[42004:3175540] critical: 	24  CoreFoundation                      0x000000011008f031 CFRunLoopRunSpecific + 625
2018-07-26 13:15:12.691484+0200 MyApp.iOS[42004:3175540] critical: 	25  GraphicsServices                    0x00000001162ce136 GSEventRunModal + 62
2018-07-26 13:15:12.691648+0200 MyApp.iOS[42004:3175540] critical: 	26  UIKitCore                           0x0000000119f90839 UIApplicationMain + 140
2018-07-26 13:15:12.691807+0200 MyApp.iOS[42004:3175540] critical: 	27  ???                                 0x000000013543b287 0x0 + 5188596359
2018-07-26 13:15:12.691983+0200 MyApp.iOS[42004:3175540] critical: 	28  ???                                 0x000000013543afe3 0x0 + 5188595683
2018-07-26 13:15:12.692140+0200 MyApp.iOS[42004:3175540] critical: 
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Logging integration: filter messages

I was unable to figure out from the documentation, but is it possible to filter log messages from being included as breadcrumbs in the Asp.net core integration? For example, I am ignoring Info-level Microsoft.* messages in my logging config, but it seems to be included as a breadcrumb. I would like Info-level messages, but not from certain log sources.

ApplicationVersionLocator returns null in some instances

The method of getting the executing assembly, Assembly.GetEntryAssembly(), can return null when the assembly is loaded from unmanaged code. In my case it's because I'm running this in an MVC5 & .NET 4.7.1 website where IIS ends up loading the site's dll and executing it.

I don't think there's any way to get this to work automagically, so setting the Release manually is the only option in this type of setup.

If this library is intended to be run in classic asp.net websites then a note about this might be nice in the docs.

Strong naming error with version 0.0.1-preview2

I have an MVC5 site and some Azure WebJobs (plain .net 4.7.1 console apps) that are all using Microsoft.Extensions.Logging so I wanted to give the ILogger implementation a try. The WebJobs are running fine and exceptions are being logged as expected, but with the website I'm getting the following error when the site starts up:

Could not load file or assembly 'Sentry.PlatformAbstractions' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)

I'm not sure if it matters but the WebJobs are using the new SDK style project files while the website is the old style.

  • Sentry: 0.0.1-preview2
  • Sentry.Extensions.Logging: 0.0.1-preview2
  • Sentry.PlatformAbstractions: 1.0.0-dev-00070
  • System.Collections.Immutable: 1.5.0

Offline caching

I am using sentry in an offshore environment and depending on the position of the vessel we don't have an internet connection. How can I cache the messages and send as soon as the internet is back on?

I saw that other implementations have same needs (JS with offline first progressive web apps). So please think about handling this as a feature request - workaround is also welcome.

Opt-in to replace `Task.Run` with dedicated thread

If configured, it should be possible to avoid a potential thread-pool starvation affect events being sent to Sentry, replace the BackgroundWorker's Task.Run with:

Task.Factory.StartNew(..., TaskCreationOptions.LongRunning);

The trade-off is: With Task.Run, there will be no dedicated thread allocated which reduces the footprint of the SDK into an app. On the other hand, if a thread-pool starvation happens and the app locks down, no events queued would be sent to Sentry.

This will also allow a potential health check that will monitor and send an event to sentry if thread-pool starvation happens.

Adding sentry tags via logger properties

I would like a way to add tags to my sentry events via _logger.Log generic logger.
I don't want to have to call Sentry specific functions to add tags, the abstract logger provided by Microsoft can already provide these "properties" or "structured logging" to Sentry, so sentry should be able to pick them up and add them as tags.

SENTRY_ENVIRONMENT doesn't override ASPNETCORE_ENVIRONMENT

I'm setting ASPNETCORE_ENVIRONMENT to Staging and SENTRY_ENVIRONMENT to Development. If I inject IOptions<SentryAspNetCoreOptions> the Environment value I get back is Staging not Development. I'm not sure if this is right but I'd expect this, and the Release value which is empty, to be set on the options instead of being checked for and set in

private readonly Lazy<string> _release = new Lazy<string>(ReleaseLocator.GetCurrent);
private readonly Lazy<string> _environment = new Lazy<string>(EnvironmentLocator.GetCurrent);

I'm trying to get these values so I can inject them into a Tag Helper to write out the JS snippet. I'd like to PR this once I have it fully working without any hacks.

Error while processing asp.net core event

I occasionally see the following when using CaptureMessage from an Asp.net core app:

There was 1 error encountered while processing this event

Discarded invalid value for parameter 'request'

Name: request
Value: 
{env: {REMOTE_ADDR: 10.11.103.12, SERVER_NAME: 11cb6611-40c6-34-79ee-7d2e, SERVER_PORT: 8080}, method: , query_string: }

I am using Sentry-dotnet 1.0.0 with On-Prem 9.0.0.

The code calling the CaptureMessage is from a BackgroundWorker service running on a schedule (no web request)

Events fail to send when compression is enabled

I am seeing this in the debug log:

Sentry responded with status 'BadRequest' for event 9a6e423b-63e2-4e39-bec6-9a58088bfb9f. Message: No JSON data was found

Here is the code I am running;

static void Main()
{
    using ( SentrySdk.Init("https://<id>@<on_prem_server>") )
    {
        SentrySdk.CaptureMessage("Sample Test 1");
    }
}

I have an on-premise 9.0.0 server.

The following code successfully sends issues:

using (var sdk = SentrySdk.Init(s =>
{
    s.Dsn = new Dsn("https://<id>@<on_prem_server>");
    s.Http(h =>
    {
        h.RequestBodyCompressionLevel = System.IO.Compression.CompressionLevel.NoCompression;
    });

}))
{
    SentrySdk.CaptureMessage("Sample Test 1");
}

Feature: Add ability to capture data/tags/etc with message/exception

If possible, it would be nice to add extra data, add tags, modify the fingerprint, etc from the CaptureMessage/CaptureException/CaptureEvent methods.

Alternatively, it would also be nice to have an option to add tags or additional data via the SentrySdk method (i.e. SentrySdk.SetTag). It appears the only way to add tags to the scope is via the ConfigureScope option, which is only run once per scope.

Create a SentryId struct to hold Id

As raised in this forum post the default conversion of the CaptureException method return type Guid to a string is not in a format Sentry allows searching for.

Create a struct SentryId which hold a Guid and overrides ToString to use the format: ToString("n").

Implement the implicit operator to Guid.

Support .NET Framework 4.5

Raising this to get some feedback if there's demand to support .NET Framework 4.5

I've opened a PR (WIP): #142 but unless there's demand for it, it's not worth maintaining another target.
So please give it a thumbs up if this is something that helps you.

Scope data from async methods missing

Given the following code:

private static async Task doThings()
{
    SentrySdk.AddBreadcrumb("things crumb");
    SentrySdk.ConfigureScope(o => o.SetTag("tag1", "a"));
}

public static async Task<int> Main(string[] args)
{
    using (var sdk = SentrySdk.Init(s =>
     {
          s.Dsn = new Dsn("<url>");
     }))
    {
        await doThings();
        SentrySdk.CaptureMessage("Sample event");
    }

    return 0;
}

No breadcrumbs/tags are available or sent to the Sentry endpoint. If I convert the function to non-async, the breadcrumb and tag is available.

ASP.NET Core: Configure scope during `UseSentry`

In order to facilitate setting some values that will be used on all events, expose a ConfigureScope on SentryOptions:

.UseSentry(o =>
{
  o.ConfigureScope(s => s.SetExtra("extra", "sent with all events");
{

Data persisting after scope dispose

I updated to preview 3 and am using the following code in an ASP.Net Core 2.1 controller function:

SentrySdk.CaptureMessage("test a");

using (SentrySdk.PushScope())
{
    SentrySdk.ConfigureScope(o =>
    {
        o.SetExtra("NewScope", true);
    });

    SentrySdk.CaptureMessage("test b");
}

SentrySdk.CaptureMessage("test c");

"test a" has no additional data. Both "test b" and "test c" have 'NewScope: true' in the additional data. I would expect "test c" to not include this.

I was not able to reproduce in a console app, just Asp.Net core. I also updated the controller to include "[FromServices] IHub sentryContext", and updated "SentrySdk" to use "sentryContext" and noted the same behavior.

Settings aren't being picked up from appsettings.json when calling loggerFactory.AddSentry()

I'm using Sentry in a .net core console app without the generic host. This is my basic setup though I have refactored it a bit as you'll see below.

When I add Sentry to the LoggerFactory it's not picking up the settings from my appsettings.json as expected. The following code is what's currently working for me:

Program.cs

public static void Main(string[] args)
{
    SetupConfiguration(args);
    SetupServices();

    using (Services)
    using (var loggerFactory = Services.GetService<ILoggerFactory>())
    {
        // ...
    }
}

private static void SetupServices()
{
    var instrumentationKey = Configuration.GetValue<string>("APPINSIGHTS_INSTRUMENTATIONKEY");

    var loggerFactory = new LoggerFactory()
                        .AddConsole()
                        .AddSentry(options => Configuration.Bind("Sentry", options)); // This ensures the settings are loaded

    if (!string.IsNullOrEmpty(instrumentationKey))
    {
        loggerFactory.AddApplicationInsights(instrumentationKey, null);
    }

    var services = new ServiceCollection()
                   .AddSingleton(Configuration)
                   .AddSingleton(loggerFactory)
                   .AddLogging(config =>
                   {
                       //config.AddSentry();
                   });

    ConfigureServices(services);

    Services = services.BuildServiceProvider();
}

private static void SetupConfiguration(string[] args)
{
    var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");

    var builder = new ConfigurationBuilder()
        .SetBasePath(Directory.GetCurrentDirectory())
        .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
        .AddJsonFile($"appsettings.{environment}.json", optional: true, reloadOnChange: true)
        .AddEnvironmentVariables();

    if (string.Equals(environment, "Development", StringComparison.OrdinalIgnoreCase))
    {
        builder.AddUserSecrets<Functions>();
    }

    if (args != null)
    {
        builder.AddCommandLine(args);
    }

    Configuration = builder.Build();
}

appsettings.json

{
  "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Warning"
    }
  },

  "Sentry": {
    "Dsn": "https://[email protected]/xxxx"
  }
}

I've tried moving the .AddSentry() call to inside .AddLogging() but I'm not able to get all of the loggers to resolve with a mixed configuration, so I need to stick to one method of setup for now. I did try loading just the console & sentry loggers inside .AddLogging() and the settings weren't being picked up in there either.

The latest WebJobs SDK beta uses HostBuilder which is what asp.net core is built on and .net core console apps are meant to use. This will allow for a similar configuration setup to asp.net core. These builds haven't been published to MyGet or NuGet so I haven't tried them out yet.

Enable Sentry on certain environments

I want to log to Sentry only when the environment is set to production, but with this code all exceptions are logged to Sentry in any environment... What am I missing?

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseSentry(options =>
                {
                    var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");

                    if (env == "Production")
                    {
                        options.Dsn = "DNS Key Here";
                        options.Environment = env;
                        options.IncludeRequestPayload = true;
                        options.IncludeActivityData = true;
                    }
                })
                .UseStartup<Startup>();

Exception

        public virtual Task<List<TEntity>> GetAllAsync()
        {
            throw new InvalidOperationException();
            return this.context.Set<TEntity>().ToListAsync();
        }

And it was logged...
I tried to implement something similar with a middleware in Configure method on Startup class but with no success.

Thanks in advance!

Bitbucket integration issue

Hi,
why can't I add repository to project? I've added bitbucket account, but I can't add repo, add repository button is disabled:

image

OperatingSystem no longer from user agent

In the old client I'm sure that the OS was picked up and parsed from the user agent, however now it's just the OS of the server.

In Sentry.Protocol.OperatingSystem it says:

/// In web contexts, this is the operating system of the browser (normally pulled from the User-Agent string).

But in sentry-dotnet where it populates this context it takes the server OS.

Is this by design now? is there anyway to override this with the client OS from the user agent? temporarily I'm adding tags with this info but I preferred how it worked previously.

Thanks

Feature Request: Allow Breadcrumb data to accept objects as values

Currently, the breadcrumb accepts additional data as a dictionary of <string,string>. Allowing objects as values would remove the need for end-users to serialize. Currently, the SentryEvent extras accepts <string,object>, updating breadcrumb to be the same would be useful.

Request: Add event/exception processors outside of init

In our usage we have a library that only contains calls to the static capture methods, thus relying on the consuming application to init the SDK before calling library functions. It would be useful to add event processors (AddEventProcessor) outside of the init method for this purpose. As an example:

Console program:

using (SentrySdk.Init(o =>
{
    o.Dsn = new Dsn("<url>");
}))
{
    Library.LibraryFunction();
}

Library:

void LibraryFunction()
{
    SentrySdk.AddEventProcessor(new MySentryEventProcessor());
    SentrySdk.CaptureMessage("Action");
}

Setting the environment

I'm trying to setup the ILogger implementation in my project and I want to set the environment like I'm doing with the javascript client. On the SentryOptions class there's Dsn and Release properties but I'm not seeing anything for the Environment. How would this be set on the logger, or is it not implemented yet?

Strong name the assemblies

Taking into consideration the Microsoft documentation states:

If you are an open-source developer and you want the identity benefits of a strong-named assembly, consider checking in the private key associated with an assembly into your source control system.

Create a signing key (snk) and push to the repository.
Sign packages.

SDK Information

All SDKs should send SDK information like this:

for Sentry it should look like this:

{
  "name": "sentry.dotnet",
  "version": "1.0.0-rc2",
  "packages": [
    {
      "name": "nuget:Sentry",
      "version": "1.0.0-rc2"
    },
  ]
}

for Sentry.AspNetCore it should look like this:

{
  "name": "sentry.dotnet.aspnetcore",
  "version": "1.0.0-rc2",
  "packages": [
    {
      "name": "nuget:Sentry",
      "version": "1.0.0-rc2"
    },
    {
      "name": "nuget:Sentry.AspNetCore",
      "version": "1.0.0-rc2"
    },
  ]
}

and so on ...

.NET SDK redesign

This issue can be used to discuss the kickoff of a new API for .NET applications.

Some goals to start with are:

  • Targeting .NET Standard 2.0
    • Multi-targeting is hard. The further back you go, the harder it gets. We already have support for .NET 3.5 on the current SDK so there's no reason to attempt to support it on something we're building for the future.
    • There hasn't been any user request to .NET Standard 1.x. There are many essential APIs missing and we'd surely spend quite sometime working around that of simply leaving features off for those targets.
    • This could obviously change and if there is demand, we can simple add the other targets later. Building it on the API offered by .NET Standard 2.0 will speed up the feature rich version though.

Proposed API for sending event:

public class SentryEvent
{
    // Contains fields of the Sentry protocol 
    // This type gets serialized
}

public interface ISentryClient 
{
    Guid CaptureEvent(SentryEvent @event);
}

The client API queues the event for processing/submission via a in-memory queue. In the background there's a task which asynchronously does the event submission. For that reason the API has a IDisposable handle be invoked on app shutdown, which when invoked could block up to N seconds to ensure all events are sent to sentry or persisted to disk if that option is enabled (useful for mobile).

Convenience methods added as extensions, i.e:

public static class SentryClientExtensions
{
    SentryResponse CaptureException(
        this ISentryClient client, 
        Exception exception)
}

The client manages a background worker which invokes a transport. Different transports can be used. For example an HTTP transport should be default but one that will store the event to disk to be sent at a later time could be another one.

Milestones:

  1. The first preview release will include a subset of the interfaces and attributes spec, the HttpTransport and an Microsoft.Extensions.Logging and ASP.NET Core integrations. The extenal API should be close to the final one which is part of the Sentry SDK's unification workload.
  2. Second release will aim finishing support to the Sentry doc's spec
  3. More integrations

If you can support us by testing the previews, that'd be highly appreciated.

Xamarin Android: Unhandled exceptions never received in Sentry console

I'm not sure how to configure the new unified Sentry Sdk in order for it to capture unhandled exceptions. I've spent a day attempting to get it to send out unhandled exceptions, but they don't seem to work properly in a Xamarin Android app.

The initialization of Sentry is performed like this:

SentryClient = SentrySdk.Init(o => {
    o.Dsn = new Dsn(AppConfig.SentryDSN);
    o.Debug = true;
});

As per comments in #96 I added:

AppDomain.CurrentDomain.ProcessExit += (object sender, EventArgs e) => {
    SentryClient.Dispose();
};

Then, elsewhere in the Android code (an Activity for example), given the following lines, I get two different results:

SentrySdk.CaptureException(new Exception("Manually thrown exception")); // this makes it to Sentry.
throw new Exception("Unhandled exception"); // adding this line causes neither exception to make it to Sentry.

In the application console, I can see information regarding the event:

Info: Capturing event.
Debug: Running processor on exception: Unhandled exception
Debug: Creating SentryStackTrace. isCurrentStackTrace: False.
Debug: Running main event processor on: Event <event-id>
Debug: Event queued up.
Info: Disposing the Hub.
Debug: Disposing SentryClient.
Debug: Disposing BackgroundWorker.
Debug: Event <event-id> in-flight to Sentry. #0 in queue.
Debug: Disposing scope.
Debug: Disposing SentryClient.

Randomly (at some point after playing around with various configurations), the Sentry console has received an event with <unlabeled event> as its title, and "Discarded invalid value for parameter 'exception'" in the processing errors, but we are unable to determine if this is unhandled or not?

Additionally, if I use o.DisableAppDomainUnhandledExceptionCapture() and set up my own exception handler on AppDomain these aren't sent either!

Is there anything obvious that I am doing wrong? Based on the documentation I don't think there's much more I should be doing.

Incompatible with Serilog.AspNetCore

I'm not sure if this is an issue that would need to be fixed on the side of serilog/serilog-aspnetcore or sentry, but currently they cannot be used together.

The following code results in an exception on startup:

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
    WebHost.CreateDefaultBuilder(args)
        .UseStartup<Startup>()
        .UseSentry()
        .UseSerilog();
λ dotnet run
Using launch settings from C:\Users\Mitchell\source\repos\WebApplication4\WebApplication4\Properties\launchSettings.json...
Application startup exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Sentry.SentryOptionsExtensions.AddEventProcessorProvider(SentryOptions options, Func`1 processorProvider) in C:\projects\sentry-dotnet\src\Sentry\SentryOptionsExtensions.cs:line 80
   at Microsoft.AspNetCore.Builder.ApplicationBuilderExtensions.UseServiceProviderProcessors(IServiceProvider provider) in C:\projects\sentry-dotnet\src\Sentry.AspNetCore\ApplicationBuilderExtensions.cs:line 37
   at Microsoft.AspNetCore.Builder.ApplicationBuilderExtensions.UseSentry(IApplicationBuilder app) in C:\projects\sentry-dotnet\src\Sentry.AspNetCore\ApplicationBuilderExtensions.cs:line 26
   at Sentry.AspNetCore.SentryStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder e) in C:\projects\sentry-dotnet\src\Sentry.AspNetCore\SentryStartupFilter.cs:line 13
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at Sentry.SentryOptionsExtensions.AddEventProcessorProvider(SentryOptions options, Func`1 processorProvider) in C:\projects\sentry-dotnet\src\Sentry\SentryOptionsExtensions.cs:line 80
   at Microsoft.AspNetCore.Builder.ApplicationBuilderExtensions.UseServiceProviderProcessors(IServiceProvider provider) in C:\projects\sentry-dotnet\src\Sentry.AspNetCore\ApplicationBuilderExtensions.cs:line 37
   at Microsoft.AspNetCore.Builder.ApplicationBuilderExtensions.UseSentry(IApplicationBuilder app) in C:\projects\sentry-dotnet\src\Sentry.AspNetCore\ApplicationBuilderExtensions.cs:line 26
   at Sentry.AspNetCore.SentryStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder e) in C:\projects\sentry-dotnet\src\Sentry.AspNetCore\SentryStartupFilter.cs:line 13
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.StartAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token, String shutdownMessage)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.RunAsync(IWebHost host, CancellationToken token)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host)
   at WebApplication4.Program.Main(String[] args) in C:\Users\Mitchell\source\repos\WebApplication4\WebApplication4\Program.cs:line 18

Release sentry on nuget with net461 target

We are trying to add sentry to one of our Sitefinity 10.1.6520.0 projects but we are getting Severity Code Description Project File Line Suppression State Error Unable to find a version of 'Autofac' that is compatible with 'Progress.Sitefinity.Authentication 11.1.6800 constraint: Autofac (= 3.5.2)'.

Is there anyway to get around this error message?

Using .net 4.6.1 and installing Sentry from nuget

Feature: Add Flush/Close SentrySdk method

For situations where the SentrySdk is not in a using block, it would be nice to have a way to formally close/flush pending methods and possibly await. For example, this code in a console app will often result in no or missing messages:

public static async Task<int> Main(string[] args)
{
    SentrySdk.Init(s =>
    {
        s.Dsn = new Dsn("<url>");
    });

    SentrySdk.CaptureMessage("Message 1");
}

The primary reason for not simply having a using block involves multiple libraries/modules in my code.

Adding a function such as "SentrySdk.Flush();" or "await SentrySdk.FlushAsync(CancellationToken);" to ensure all messages have been sent would be nice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.