Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Exceptionless .NET Clients

[![Build Windows](https://github.com/exceptionless/Exceptionless.Net/workflows/Build%20Windows/badge.svg?branch=master)](https://github.com/Exceptionless/Exceptionless.Net/actions)
[![Build OSX](https://github.com/exceptionless/Exceptionless.Net/workflows/Build%20OSX/badge.svg)](https://github.com/Exceptionless/Exceptionless.Net/actions)
[![Build Linux](https://github.com/exceptionless/Exceptionless.Net/workflows/Build%20Linux/badge.svg)](https://github.com/Exceptionless/Exceptionless.Net/actions)
[![Build Windows](https://github.com/Exceptionless/Exceptionless.Net/actions/workflows/build-windows.yml/badge.svg?branch=main)](https://github.com/Exceptionless/Exceptionless.Net/actions/workflows/build-windows.yml)
[![Build OSX](https://github.com/Exceptionless/Exceptionless.Net/actions/workflows/build-osx.yml/badge.svg?branch=main)](https://github.com/Exceptionless/Exceptionless.Net/actions/workflows/build-osx.yml)
[![Build Linux](https://github.com/Exceptionless/Exceptionless.Net/actions/workflows/build-linux.yml/badge.svg?branch=main)](https://github.com/Exceptionless/Exceptionless.Net/actions/workflows/build-linux.yml)
[![NuGet Version](http://img.shields.io/nuget/v/Exceptionless.svg?style=flat)](https://www.nuget.org/packages/Exceptionless/)
[![Discord](https://img.shields.io/discord/715744504891703319)](https://discord.gg/6HxgFCx)

Expand All @@ -29,8 +29,8 @@ editor design surfaces are available.

1. You will need to install:
1. [Visual Studio 2022](https://visualstudio.microsoft.com/vs/community/)
2. [.NET Core 6.x & 8.x SDK with VS Tooling](https://dotnet.microsoft.com/download)
3. [.NET Framework 4.6.2 Developer Pack](https://dotnet.microsoft.com/download/dotnet-framework/net462)
2. [.NET 10 SDK with Visual Studio tooling](https://dotnet.microsoft.com/download)
3. [.NET Framework 4.7.2 Developer Pack](https://dotnet.microsoft.com/download/dotnet-framework/net472)
2. Open the `Exceptionless.Net.slnx` Visual Studio solution file.
3. Select `Exceptionless.SampleConsole` as the startup project.
4. Run the project by pressing `F5` to start the console.
Expand All @@ -43,7 +43,7 @@ build windows specific packages.

1. You will need to install:
1. [Visual Studio Code](https://code.visualstudio.com)
2. [.NET Core 6.x & 8.x SDK with VS Tooling](https://dotnet.microsoft.com/download)
2. [.NET 10 SDK](https://dotnet.microsoft.com/download)
2. Open the cloned Exceptionless.Net folder.
3. Run the `Exceptionless.SampleConsole` project by pressing `F5` to start the console.

Expand Down
8 changes: 4 additions & 4 deletions build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageOutputPath>$(SolutionDir)artifacts</PackageOutputPath>
<PackageIcon>exceptionless-icon.png</PackageIcon>
<PackageTags>Exceptionless;Error;Error-Handling;Error-Handler;Error-Reporting;Error-Management;Error-Monitoring;Handling;Management;Monitoring;Report;Reporting;Crash-Reporting;Exception;Exception-Handling;Exception-Handler;Exception-Reporting;Exceptions;Log;Logs;Logging;Unhandled;Unhandled-Exceptions;Feature;Configuration;Debug;FeatureToggle;Metrics;ELMAH</PackageTags>
<PackageLicenseExpression>APACHE-2.0</PackageLicenseExpression>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<RepositoryUrl>$(PackageProjectUrl)</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand All @@ -41,9 +41,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.201" PrivateAssets="All"/>
<PackageReference Include="AsyncFixer" Version="2.1.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="7.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class ValuesController : Controller {
private readonly ILogger _logger;

public ValuesController(ExceptionlessClient exceptionlessClient, ILogger<ValuesController> logger) {
// ExceptionlessClient instance from DI that was registered with the AddExceptionless call in Startup.ConfigureServices
// ExceptionlessClient instance from DI that was registered with the builder.AddExceptionless call in Program.cs.
_exceptionlessClient = exceptionlessClient;
_logger = logger;
}
Expand All @@ -21,7 +21,7 @@ public Dictionary<string, string> Get() {
// Submit a feature usage event directly using the client instance that is injected from the DI container.
_exceptionlessClient.SubmitFeatureUsage("ValuesController_Get");

// This log message will get sent to Exceptionless since Exceptionless has be added to the logging system in Program.cs.
// This log message will get sent to Exceptionless since Exceptionless has been added to the logging system in Program.cs.
_logger.LogWarning("Test warning message");

try {
Expand All @@ -42,7 +42,8 @@ public Dictionary<string, string> Get() {
handledException.ToExceptionless().Submit();
}

// Unhandled exceptions will get reported since called UseExceptionless in the Startup.cs which registers a listener for unhandled exceptions.
// Unhandled exceptions will get reported because Program.cs enables the built-in exception handler pipeline
// and wires Exceptionless into both ASP.NET Core diagnostics and middleware hooks.
throw new Exception($"Unhandled Exception: {Guid.NewGuid()}");
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Platforms\Exceptionless.AspNetCore\Exceptionless.AspNetCore.csproj" />
<ProjectReference Include="..\..\src\Platforms\Exceptionless.Extensions.Logging\Exceptionless.Extensions.Logging.csproj" />
</ItemGroup>
</Project>
</Project>
58 changes: 37 additions & 21 deletions samples/Exceptionless.SampleAspNetCore/Program.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;

namespace Exceptionless.SampleAspNetCore {
public class Program {
public static void Main(string[] args) {
CreateHostBuilder(args).Build().Run();
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureLogging(b => {
// By default sends warning and error log messages to Exceptionless.
// Log levels can be controlled remotely per log source from the Exceptionless app in near real-time.
b.AddExceptionless();
})
.ConfigureWebHostDefaults(webBuilder => {
webBuilder.UseStartup<Startup>();
});
}
}
using Exceptionless;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

var builder = WebApplication.CreateBuilder(args);

// By default sends warning and error log messages to Exceptionless.
// Log levels can be controlled remotely per log source from the Exceptionless app in near real-time.
builder.Logging.AddExceptionless();

// Reads settings from IConfiguration then adds additional configuration from this lambda.
// This also configures ExceptionlessClient.Default and host shutdown queue flushing.
builder.AddExceptionless(c => c.DefaultData["Startup"] = "heyyy");
// OR
// builder.AddExceptionless();
// OR
// builder.AddExceptionless("API_KEY_HERE");

// Adds ASP.NET Core request/unhandled exception hooks and standard exception handling services.
builder.Services.AddExceptionless();
builder.Services.AddProblemDetails();

// This is normal ASP.NET Core code.
builder.Services.AddControllers();

var app = builder.Build();

// Uses the built-in exception handler pipeline, with Exceptionless capturing via IExceptionHandler.
app.UseExceptionHandler();

// Adds Exceptionless middleware for diagnostics, 404 tracking, and queue processing.
app.UseExceptionless();

app.MapControllers();

app.Run();
41 changes: 0 additions & 41 deletions samples/Exceptionless.SampleAspNetCore/Startup.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.5" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AssemblyName>Exceptionless.SampleConsole</AssemblyName>
<OutputType>Exe</OutputType>
<DefineConstants>$(DefineConstants);NETSTANDARD;NETSTANDARD2_0</DefineConstants>
Expand All @@ -20,11 +20,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Exceptionless.DateTimeExtensions" Version="3.4.3" />
<PackageReference Include="Exceptionless.RandomData" Version="1.2.2" />
<PackageReference Include="Exceptionless.DateTimeExtensions" Version="6.0.1" />
<PackageReference Include="Exceptionless.RandomData" Version="2.0.1" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Platforms\Exceptionless.Extensions.Hosting\Exceptionless.Extensions.Hosting.csproj" />
<ProjectReference Include="..\..\src\Platforms\Exceptionless.Extensions.Logging\Exceptionless.Extensions.Logging.csproj" />
</ItemGroup>
</Project>
</Project>
8 changes: 5 additions & 3 deletions samples/Exceptionless.SampleHosting/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
// Log levels can be controlled remotely per log source from the Exceptionless app in near real-time.
builder.AddExceptionless();
})
.UseExceptionless() // listens for host shutdown and
.UseExceptionless() // initializes the client and flushes the queue during host shutdown
.ConfigureServices(services => {
// Reads settings from IConfiguration then adds additional configuration from this lambda.
// This also configures ExceptionlessClient.Default
Expand Down Expand Up @@ -64,11 +64,13 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
handledException.ToExceptionless().Submit();
}

// Unhandled exceptions will get reported since called UseExceptionless in the Startup.cs which registers a listener for unhandled exceptions.
// This simulates an unhandled exception. Host-level Exceptionless integration reports
// host/AppDomain-level unhandled exceptions; ASP.NET Core request-pipeline exceptions
// require the ASP.NET Core integration and UseExceptionHandler.
throw new Exception($"Unhandled Exception: {Guid.NewGuid()}");
});
});
});
});
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>

<!-- This property makes the build directory similar to a publish directory and helps the AWS .NET Lambda Mock Test Tool find project dependencies. -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="2.2.0" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.0" />
<PackageReference Include="Amazon.Lambda.Core" Version="2.8.1" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.5" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Exceptionless\Exceptionless.csproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.300" />
<PackageReference Include="Amazon.Lambda.AspNetCoreServer" Version="8.1.1" />
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.3.26" />
<PackageReference Include="Amazon.Lambda.AspNetCoreServer" Version="9.2.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Platforms\Exceptionless.AspNetCore\Exceptionless.AspNetCore.csproj" />
<ProjectReference Include="..\..\src\Platforms\Exceptionless.Extensions.Logging\Exceptionless.Extensions.Logging.csproj" />
</ItemGroup>
</Project>
</Project>
18 changes: 9 additions & 9 deletions samples/Exceptionless.SampleMvc/Exceptionless.SampleMvc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,35 +49,35 @@
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Web.Infrastructure, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Web.Infrastructure.2.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Web.Infrastructure.2.0.1\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json.Bson, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.Bson.1.0.2\lib\net45\Newtonsoft.Json.Bson.dll</HintPath>
<HintPath>..\..\packages\Newtonsoft.Json.Bson.1.0.3\lib\net45\Newtonsoft.Json.Bson.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
<HintPath>..\..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
<HintPath>..\..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.AspNet.WebApi.Client.6.0.0\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
<HintPath>..\..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
<HintPath>..\..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
Expand Down Expand Up @@ -284,4 +284,4 @@
</Target>
<Target Name="AfterBuild">
</Target> -->
</Project>
</Project>
Loading
Loading