Multi-platform Crash Reporting with Bugsplat

Why Crash Reporting?

Crash reporting allows us to easily find, fix, and track crashes affecting our users. Crash Reporting Tools like Bugsplat are thought of as guard dogs always ready to let you know if something goes wrong so you can identify the culprit and contain it. They also offer critical data and analysis about the number of crashes, including which devices were affected most and so on.

About Bugsplat

BugSplat enables teams to build seriously good software by streamlining their support and development process with stellar crash reporting data.

Benefits

  • Simple Setup and Configuration – Integrating BugSplat into your application is simple and straightforward for your development team
  • Advanced-Data for Debugging -BugSplat orders crashes by their frequency and severity.
  • Complements Your Team’s Workflow – integrates with your team’s favorite bug-tracking tools and other applications
  • Multiplatform support – C++, Java, .Net, Breakpad, Unity, and Osx are supported.
  • Easily Integrate with your tools -Slack, JIRA, BugZilla, DevTrack, Fogbugz, Axosoft
  • Trusted by Companies like Newforma, Atlassian, Quicken, Nitro, Prezi, Tripwire and other thousands of developers.

Simple Integration

 Integrating BugSplat crash reporting with your .NET applications is easy! Register, Login and Integrate BugSplat SDK

Enabling your application with BugSplat technology:

In a few simple steps, your .NET application can be modified to provide full debug information on the BugSplat website when it crashes.

  • Add a reference to “BugSplatDotNet.Dll”.
  • Add a call to BugSplat.CrashReporter.Init and add the BugSplat exception handlers for the appropriate set of system exceptions. As shown in the myDotNetCrasher sample app, this takes just a few lines of code.

The initialization call requires three parameters: the BugSplat database, application name, and version. You supply the application name and version. The BugSplat database is created and selected on the Databases. Typically, you will create a new database for each major release of your product.

  • Add .exe, BugSplatDotNet.dll, and BugSplatRC.dll to your application’s installer
  • Edit .dll with Visual Studio if you wish to change the banner displayed when your application crashes.
  • Add symbolic debug information to your release build.

Note: To get symbolic stack reports, debug information (PDB files) needs to be uploaded to the BugSplat website along with your application’s executable files. Modify your build settings so that symbol files are created for Release builds, e.g.,

Remember that after each build you should upload the new executable and PDB files. The myDotNetCrasher sample app uses a Visual Studio post-build event to automate this step.

  • Finally, note that the Visual Studio debugger’s hosting process can interfere with BugSplat’s ability to resolve symbols; it should be disabled in your project’s debug settings when submitting crash reports that occur while debugging.

Test your application by forcing a crash, and then verify that crashes are posted and symbol names are resolved.

Some Screenshots from Bugsplat:

Hybrid Windows Applications: Interoperability between Winforms and WPF

Windows Presentation Foundation (WPF) and Windows forms are two different mature architectures for creating Windows application interfaces. While Winforms is a time tested, developer-community approved platform, WPF is a next-generation presentation system for building Windows client applications.

Amidst all the `WPF vs Winforms’ talks, what is not well known, is that you can build hybrids, embedding WPF controls in a WinForms application or WinForms controls in a WPF application. All you need is a Simple Adapter .

The two key classes that implement inter-operation capabilities are WindowsFormsHost and ElementHost.

So When is Hybrid Application Practical?

  •  Huge investment has gone into building custom control libraries
  • Reuse controls during migration of application from one technology to another.
  • To bring the richness of WPF technology into existing Windows applications.
  • Non-availability of certain controls

Usage of ElementHost and WindowsFormsHost

How to get a Winform control working within a WPF application?

In order to use a Winforms UserControl/CustomControl within a WPF application host, the following steps must be taken:

  1. Reference the WindowsFormsIntegration.dll (should be in the GAC)
  2. Reference the actual Winforms Control Library projects
  3. Within the Window that is hosting the Winforms Control add a Winforms Interop container [WindowsFormsHost] and set the Child Property to host the actual WinFormsControlLibrary/CustomControl and example is as follows:

Screenshot of Winforms User Control now running inside WPF window.

How to get a WPF control working within a Winforms application?

In order use a WPF Control within a Winforms application host, the following steps must be taken:

  1. Reference the WindowsFormsIntegration.dll (should be in the GAC)
  2. Reference the actual WPF Control Library projects.
  3. Within the Window/Page that is hosting the Control add a WPF interop container [ElementHost] and set the Child Property to host the actual WpfControlLibrary/UserControl, and example is as follows:

Here is a screenshot of Windows application hosting a WPF Control.

You should by now have understood the fundamentals of WPF and Winforms interoperability. Also, remember that you may encounter rendering issues with more complicated controls but it is always important to be aware of the fact that as a Windows application developer, you can let Winforms and WPF controls coexist.