To send errors to Rollbar from your .NET application, you should use our Rollbar.NET SDK.

Install Rollbar.Net with Nuget:

Install-Package Rollbar

To use inside a Winforms Application, do the following inside your main method. You'll need your project's server-side access token to initialize the Rollbar.NET SDK.

static void Main()
    Rollbar.Init(new RollbarConfig
        AccessToken = "{{server_access_token}}",
        Environment = "production"

    Application.ThreadException += (sender, args) =>

    AppDomain.CurrentDomain.UnhandledException += (sender, args) =>
        Rollbar.Report(args.ExceptionObject as System.Exception);

    Application.Run(new Form1());

Then create a global action filter:

public class RollbarExceptionFilter : IExceptionFilter
    public void OnException(ExceptionContext filterContext)
        if (filterContext.ExceptionHandled)


and finally add it to the global filters collection:

private static void RegisterGlobalFilters(GlobalFilterCollection filters)
    filters.Add(new RollbarExceptionFilter());

Send a Message

Sending a message to the Rollbar server is as simple as running this command after initializing Rollbar:

Rollbar.Report("Rollbar is configured correctly");

A few seconds after you execute this code, the message should appear on your project's "Items" page.

Report an Error

To send an error, rather than a message, execute the following code after initializing Rollbar:

    int value = 1 / int.Parse("0");
catch (System.Exception ex)

A few seconds after you execute this code, an exception should appear on your project's "Items" page. This item will include the basic exception information and a stack trace, along with the values of local variables and the arguments passed to each function at each frame in the stack trace.

Add Rollbar to Your .NET Application

Once you've verified that the Rollbar SDK is configured correctly and can communicate with the Rollbar server, you'll want to add the SDK to your existing applications. See the Rollbar.NET docs here for further information.