MindscapeHQ / raygun4net

Raygun provider for .NET
https://raygun.com
MIT License
125 stars 91 forks source link

Remove the usage of LocalThread in .NET Framework versions #517

Closed phillip-haydon closed 9 months ago

phillip-haydon commented 9 months ago

Sometimes a null-ref exception occurs when building the message due to the fields being persistent in the RaygunClient when using SendInBackground.

This PR makes the data scoped to the function and passed through.

Also cleaned up some methods now that the version of C# has been updated, we can use optional parameters.

phillip-haydon commented 9 months ago

Hard to write unit tests because HttpServer doesn't fill in the HttpContext, running it up in IIS Express / IIS to test tho everything seems to be working fine.

xenolightning commented 9 months ago

Happy to move forward, due to NETFX being a pain to unit test