System.InvalidOperationException: A result has already been set on this object
See original GitHub issueSome times this exception thrown for ReusableTaskMethodBuilder.SetResult() method
11-15 03:35:58.806 E/mono-rt (12699): [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: A result has already been set on this object
11-15 03:35:58.806 E/mono-rt (12699): at System.Runtime.CompilerServices.ResultHolder`1[T].SetResult (T result) [0x00009] in <52a2eb53628f449d8fde5eb3d5b1035d>:0
11-15 03:35:58.806 E/mono-rt (12699): at System.Runtime.CompilerServices.ReusableTaskMethodBuilder.SetResult () [0x00019] in <52a2eb53628f449d8fde5eb3d5b1035d>:0
11-15 03:35:58.806 E/mono-rt (12699): at MonoTorrent.Client.NetworkIO.SendAsync (MonoTorrent.Client.Connections.IConnection2 connection, System.Byte[] buffer, System.Int32 offset, System.Int32 count, MonoTorrent.Client.RateLimiters.IRateLimiter rateLimiter, MonoTorrent.SpeedMonitor peerMonitor, MonoTorrent.SpeedMonitor managerMonitor) [0x002eb] in <12c811a85edc40f4a5c0a38806f10582>:0
11-15 03:35:58.806 E/mono-rt (12699): at System.Runtime.CompilerServices.StateMachineCache`1[TStateMachine].OnCompleted () [0x0003a] in <52a2eb53628f449d8fde5eb3d5b1035d>:0
11-15 03:35:58.806 E/mono-rt (12699): at System.Runtime.CompilerServices.ResultHolder`1[T].TryInvoke (System.Action callback) [0x0001c] in <52a2eb53628f449d8fde5eb3d5b1035d>:0
11-15 03:35:58.806 E/mono-rt (12699): at System.Runtime.CompilerServices.ResultHolder`1[T].TrySetExceptionOrResult (System.Exception exception, T result) [0x00052] in <52a2eb53628f449d8fde5eb3d5b1035d>:0
11-15 03:35:58.806 E/mono-rt (12699): at System.Runtime.CompilerServices.ResultHolder`1[T].TrySetResult (T result) [0x00000] in <52a2eb53628f449d8fde5eb3d5b1035d>:0
11-15 03:35:58.806 E/mono-rt (12699): at System.Runtime.CompilerServices.ResultHolder`1[T].SetResult (T result) [0x00000] in <52a2eb53628f449d8fde5eb3d5b1035d>:0
Issue Analytics
- State:
- Created 4 years ago
- Comments:51 (51 by maintainers)
Top Results From Across the Web
ASP.Net Core middleware cannot set status code on ...
System.InvalidOperationException: StatusCode cannot be set because the response has already started. at Microsoft.AspNetCore.Server.Kestrel.
Read more >InvalidOperationException Class (System)
InvalidOperationException is used in cases when the failure to invoke a method is caused by reasons other than invalid arguments. Typically, it is...
Read more >Adding multiple new entities at the same time results in ...
When creating multiple new entity objects and adding them to a context an exception is thrown: System.InvalidOperationException ...
Read more >object is not initialized or has already been destroyed
I've suddenly begun receiving this error after exiting play-mode. It repeats indefinitely, each editor update, until I reload assemblies.
Read more >Resolving Common Problems
System.InvalidOperationException: An error occurred while creating the form. ... System.ArgumentException: An item with the same key has already been added.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@alanmcgovern thanks for taking an interest in finding a fix. Not many maintainers care like this. I’ve really appreciated it.
It hasn’t reproduced yet, but it’ll still running on a pretty small subset of our clients. We should have a better sample size soon
I just checked myself. This error happened on November 30th, the latest version at that time was 1.0.5 So, the error seems to be related to the previous version. Right now I’m using 1.0.6 version. Such error wasn’t discovered after the 2nd of December, the day the latest version of ReusableTasks was released. I will report if this happens again with the latest version.