A sample .NET application for generating various types of crash reports and testing BugSplat crash reporting integration.
MyDotnetCrasher is a demonstration application that simulates different types of .NET exceptions and crashes, automatically capturing them with BugSplat's crash reporting service. This project is useful for:
- Testing BugSplat integration in .NET applications
- Demonstrating various crash types and stack traces
- Learning about exception handling and crash reporting workflows
- Validating symbol upload and crash analysis features
- .NET 8.0 SDK or later
- A BugSplat account
- Windows operating system (for symbol uploads)
git clone https://github.com/BugSplat-Git/my-dotnet-crasher.git
cd my-dotnet-crasher
You need to update the BugSplat database credentials in two files:
Open Program.cs
and update the Reporter
initialization with your BugSplat credentials:
private static Reporter reporter = new Reporter("your-database", "MyDotnetCrasher", "1.0.0");
Replace:
"your-database"
- Your BugSplat database name"MyDotnetCrasher"
- Your application name (can be customized)"1.0.0"
- Your application version
Open MyDotnetCrasher.csproj
and update the symbol upload configuration in the UploadSymbols
target:
<Exec Command=".\Tools\symbol-upload-windows.exe -b your-database -a MyDotnetCrasher -v 1.0.0 -u [email protected] -p your-password -f "**/*.{pdb,exe,dll}" -d "./bin""/>
Replace:
-b your-database
- Your BugSplat database name-a MyDotnetCrasher
- Your application name (should match Program.cs)-v 1.0.0
- Your application version (should match Program.cs)-u [email protected]
- Your BugSplat login email-p your-password
- Your BugSplat password
Note: The symbol upload step automatically runs after each build to ensure your crash reports include file names and line numbers.
Build the application using the .NET CLI:
dotnet build
This will:
- Restore NuGet packages (including BugSplatDotNetStandard)
- Compile the application
- Automatically upload debug symbols (PDB files) to BugSplat
The executable will be located at: bin\Debug\net8.0\MyDotnetCrasher.exe
The application supports multiple crash types that can be triggered via command-line arguments.
Run the application with one of the following crash type arguments:
# Generic exception (default if no argument provided)
dotnet run exception
# Null reference exception
dotnet run nullref
# Divide by zero exception
dotnet run divzero
# Index out of range exception
dotnet run index
# Aggregate exception (multiple errors)
dotnet run aggregate
# Unobserved task exception (async exception not awaited)
dotnet run unobserved
Or run the compiled executable directly:
.\bin\Debug\net8.0\MyDotnetCrasher.exe nullref
When a crash occurs, the application will:
- Catch the exception using global exception handlers
- Print exception details to the console
- Generate a Windows minidump file
- Upload the crash report and minidump to BugSplat
- Exit with error code 1
After generating crash reports, you can view and analyze them on the BugSplat dashboard:
- Log in to your BugSplat account
- Select your database from the dropdown menu
Navigate to the Crashes page to see all reported crashes. You'll see:
- Crash ID - Unique identifier for each crash
- Application - "MyDotnetCrasher"
- Version - The version you configured (e.g., "1.0.0")
- Exception Type - The type of exception that occurred
- Date/Time - When the crash occurred
- User - User identifier (if configured)
Click on the ID of any crash to view detailed information:
- Call Stack - Full stack trace with file names and line numbers (thanks to uploaded symbols)
- Exception Message - The error message from the exception
- Minidump - Download the native minidump for advanced debugging
- System Information - OS version, .NET version, etc.
- Custom Metadata - Any additional data attached to the crash
BugSplat automatically groups similar crashes together, making it easy to:
- Identify which crashes affect the most users
- Track crash trends over time
- Prioritize bug fixes based on impact
my-dotnet-crasher/
βββ Program.cs # Main application entry point and crash simulation
βββ Reporter.cs # BugSplat integration and crash reporting logic
βββ MyDotnetCrasher.csproj # Project configuration and symbol upload
βββ Tools/
β βββ symbol-upload-windows.exe # BugSplat symbol upload utility
βββ bin/
βββ Debug/
βββ net8.0/ # Build output and executable
- Multiple Crash Types - Demonstrates 6 different exception scenarios including unobserved task exceptions
- Automatic Symbol Upload - PDB files uploaded on every build
- Minidump Generation - Creates native Windows minidumps for detailed debugging
- Comprehensive Exception Handling - Catches both synchronous and asynchronous unhandled exceptions
- Nested Call Stack - Simulates realistic application structure for better stack traces
- Verify the symbol upload completed successfully during build
- Check that database name, application name, and version match between Program.cs and MyDotnetCrasher.csproj
- Ensure you're using the correct BugSplat credentials
- Verify your BugSplat credentials are correct
- Check your internet connection
- Look for error messages in the console output
- Ensure the database name is correct
- Verify the
Tools\symbol-upload-windows.exe
file exists - Check that your BugSplat login credentials are correct
- Ensure you have an active internet connection
This is a sample application provided for demonstration purposes.