Skip to content

Commit

Permalink
Try to add Sentry without SDK, see : getsentry/sentry-dotnet#2614
Browse files Browse the repository at this point in the history
  • Loading branch information
manuc66 committed Sep 12, 2023
1 parent 39741cd commit 1f11fbc
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 24 deletions.
2 changes: 0 additions & 2 deletions ImgTagFanOut/Dao/ImgTagFanOutDbContext.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;

namespace ImgTagFanOut.Dao;
Expand Down
1 change: 0 additions & 1 deletion ImgTagFanOut/Dao/ParameterDao.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;

Expand Down
35 changes: 18 additions & 17 deletions ImgTagFanOut/ImgTagFanOut.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,46 @@
</PropertyGroup>

<ItemGroup>
<Folder Include="Migrations\"/>
<AvaloniaResource Include="Assets\**"/>
<Folder Include="Migrations\" />
<AvaloniaResource Include="Assets\**" />
<Folder Include="Models\CompareAlgorithms\" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.4"/>
<PackageReference Include="Avalonia.Desktop" Version="11.0.4"/>
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.4"/>
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.4"/>
<PackageReference Include="Avalonia" Version="11.0.4" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.4" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.4" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.4" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.4"/>
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.4"/>
<PackageReference Include="DynamicData" Version="7.14.2"/>
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.4" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.4" />
<PackageReference Include="DynamicData" Version="7.14.2" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.10"/>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.10">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.10"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.6"/>
<PackageReference Include="SQLitePCLRaw.core" Version="2.1.6"/>
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="2.1.6"/>
<PackageReference Include="SQLitePCLRaw.provider.e_sqlite3" Version="2.1.6"/>
<PackageReference Include="Sentry" Version="3.39.1" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.6" />
<PackageReference Include="SQLitePCLRaw.core" Version="2.1.6" />
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="2.1.6" />
<PackageReference Include="SQLitePCLRaw.provider.e_sqlite3" Version="2.1.6" />
</ItemGroup>


<ItemGroup>
<None Remove="NoPreview.png"/>
<EmbeddedResource Include="NoPreview.png"/>
<None Remove="NoPreview.png" />
<EmbeddedResource Include="NoPreview.png" />
<EmbeddedResource Update="Resources\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
Expand Down
34 changes: 31 additions & 3 deletions ImgTagFanOut/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Avalonia;
using Avalonia.ReactiveUI;
using System;
using System.IO;
using System.Reflection;
using Avalonia.Dialogs;
using System.Reactive;
using ReactiveUI;
using Sentry;

namespace ImgTagFanOut;

Expand All @@ -24,6 +24,34 @@ public static AppBuilder BuildAvaloniaApp() =>
{
UseDBusFilePicker = false // to disable FreeDesktop file picker
})
.AfterSetup(_ =>
{
SentrySdk.Init(o =>
{
// Tells which project in Sentry to send events to:
o.Dsn = "https://2fd61307fdf9b3a63804db34c9bc51eb@o4505868956860416.ingest.sentry.io/4505869112639488";
// When configuring for the first time, to see what the SDK is doing:
o.Debug = true;

// This option is recommended. It enables Sentry's "Release Health" feature.
o.AutoSessionTracking = true;

// Set TracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
o.TracesSampleRate = 1.0;
});
AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) =>
{
if (e.ExceptionObject is Exception ex)
{
SentrySdk.CaptureException(ex);
}
};
RxApp.DefaultExceptionHandler = Observer.Create<Exception>(e =>
{
SentrySdk.CaptureException(e);
});
})
.WithInterFont()
.LogToTrace()
.UseReactiveUI();
Expand Down
1 change: 0 additions & 1 deletion ImgTagFanOut/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Threading.Tasks;
using Avalonia.Controls;
using Avalonia.ReactiveUI;
using ImgTagFanOut.ViewModels;
using ReactiveUI;
Expand Down

0 comments on commit 1f11fbc

Please sign in to comment.