I am getting the following internal Rollbar error when adding Rollbar.NET to my simple console app that targets the 4.7.2 Framework, and run it:
Unhandled Exception: Rollbar.RollbarException: Exception while initializing the internal services! ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Rollbar.RollbarInfrastructure.Init(IRollbarInfrastructureConfig config)
--- End of inner exception stack trace ---
at Rollbar.RollbarInfrastructure.Init(IRollbarInfrastructureConfig config)
at PapyrusNotifierConsole.Module1.ConfigureRollbar() in C:\projects\PapyrusNotifier\PapyrusNotifierConsole\Module1.vb:line 11
at PapyrusNotifierConsole.Module1.Main() in C:\projects\PapyrusNotifier\PapyrusNotifierConsole\Module1.vb:line 15
Here is the relevant code:
Sub ConfigureRollbar()
Dim rollbarInfrastructureConfig As RollbarInfrastructureConfig = New RollbarInfrastructureConfig("thiscodecamefromrollbarprojectsetuppage")
RollbarInfrastructure.Instance.Init(rollbarInfrastructureConfig)
End Sub
Sub Main()
ConfigureRollbar()
RollbarLocator.RollbarInstance.Info("Rollbar is configured properly.")
Can someone help me? I've not had any luck googling a solution.
Imports Rollbar
Module Module1
Sub Main()
'Write messages to console window
Console.WriteLine("Welcome to this Console Application.")
Console.WriteLine("Loading main application data...")
Console.WriteLine("|")
Console.WriteLine("|-")
Console.WriteLine("|-|")
Console.WriteLine("|-|-")
Console.WriteLine("|-|-|")
'Load Rollbar
ConfigureRollbar()
'Execute Functions
HandledError()
Console.WriteLine("Ready.... press any key to exit.")
'Keeps the Window Open Until a Key press
Console.Read()
End Sub
Sub ConfigureRollbar()
Dim objRollbarSettings As New RollbarLoggerConfig("XXX", "Production")
RollbarLocator.RollbarInstance.Configure(objRollbarSettings)
RollbarLocator.RollbarInstance.Info("Rollbar is configured properly.")
End Sub
Sub HandledError()
Try
'Generate Error Here
Dim intValue As Integer
Dim intValue2 As Integer = 0
'Generate Error Here
intValue = 1 / intValue2
Catch ex As Exception
RollbarLocator.RollbarInstance.Error(ex)
End Try
End Sub
End Module