I am trying to add sentry intergration to an old winforms application that currently uses .net framework 4.7.2
For test purposes the main function only contains following code :
SentryId id; SentryOptions op = new SentryOptions(); op.Dsn = new Dsn(my dsn goes here); op.Debug = true; using (var sentry = SentrySdk.Init(op)) { id = SentrySdk.CaptureException(new Exception("testException")); }
When I try to run the application I get the following error.
Error: An error occured when capturing the event System.IO.FileNotFoundException: File or assembly System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
or some of its dependencies cannot be loaded. File not found.
Filename: ‘System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’
target Sentry.Internal.MainSentryEventProcessor.Process(SentryEvent event)
target Sentry.SentryClient.DoSendEvent(SentryEvent event, Scope scope) in file C:\projects\sentry-dotnet\src\Sentry\SentryClient.cs:line 141
target Sentry.SentryClient.CaptureEvent(SentryEvent event, Scope scope) in file C:\projects\sentry-dotnet\src\Sentry\SentryClient.cs:line 88
The stacktrace was partially in finnish and I have translated so it might not be identical on different computer. I have tried creating entirely different application and sentry works fine on that so problem is not in the development environment.
OS: window 10 pro
IDE: Visual Studio Professional 2019 Version 16.5.4