Closed dougwaldron closed 2 years ago
I will have a look into this for you today.
Ok so I worked out what is going on.
Somewhere else in your app you are probably using raygunClient.Send(e,new []{"SomeOtherTag"});
The IList
(,new []{"SomeOtherTag"}
) added in the raygunClient.Send()
has a fixed length. Which is giving your error.
So as a workaround you could change:
raygunClient.Send(e,new []{"SomeOtherTag"});
To;
raygunClient.Send(e,new List<string>{"SomeOtherTag"});
I will see about making a contribution, to safely convert new []{}
into a List<String>
inside the .Send()
method.
I appreciate your looking into this!
I don't manually send exceptions anywhere in the application, and I don't add tags anywhere other than the client provider posted above. So I went back to check on Raygun for the original exception and discovered it came through with a single tag:
"Tags": [
"UnhandledException"
],
Looking for this tag in the Raygun middleware shows the tag is indeed getting added as a fixed-size array:
Fixing that line should do the trick! Let me know if I can submit a PR.
Yes please submit a PR! I'll get that approved and deployed asap.
This fix should be available on NuGet shortly
Thanks again, much appreciated!
When my application throws an exception that is logged by Raygun, I get a second exception report from the Raygun client itself that occurs when my Raygun Client Provider tries to add a tag:
The call to
Tags.Add()
throwsSystem.NotSupportedException
: "Collection was of a fixed size." The stack trace from the Raygun report:I have another, very similar application with the same Client Provider where this issue does not occur. The only relevant difference between them that I can think of is that this app has
<Nullable>enable</Nullable>
in the "csproj" file. Could it be that with nullable reference types enabled, theTags
property is getting initialized with a fixed-size data structure, like an Array?