Closed famasf1 closed 2 months ago
No parameterless constructor defined for 'StreamJsonRpc.RequestIdJsonConverter'
But there is one (by virtue of not defining any at all, C# will declare a default constructor.
That, and the fact that you said you're publishing a self-contained, arch-specific and release build app, suggests you may also be trimming. Enabling trimming in your build causes APIs that can't be clearly seen to be used to be removed. But that breaks reflection cases, such as serializers, which causes the error that you're seeing.
If you disable trimming, it'll work.
And no, we have no plans to invest time to making StreamJsonRpc work in a trimmed app at this point. But if you want to contribute support yourself, with tests, let us know what you plan and we may accept such a PR.
I'm trying to build a self-contained console app with .Net Core 8. I picked win-x64 for publish and testing it on my Windows 11. The executable file inside folder .net8.0, runtime and Debug build work fine. However when I tried to run the app through release built with self-contained option. I got this error
Unhandled Exception: Newtonsoft.Json.JsonSerializationException: Unable to deserialize JsonRpcMessage.
Here's the full error log.
I'm not sure why this issue is unique only through Release build. So unfortunately I have no idea what really caused it or can even do an attempted guess. If anyone know the answer, I thank you in advance!