Hi guys,
I’m new to FiveM development and I’m kinda messing around with resources.
I tried different approaches to exchange data between client and server. After some attempts I managed to make it work using a portable version of Newtonsoft.Json. I’m serializing a custom data transfer object in JSON format on the client side and then deserializing in on the server side.
As far as I can tell, seems like I can only use portable libraries on the client side and that’s why with a non-portable version of Newtonsoft.Json I was getting MethodNotSupportedException.
Now I was taking a look to a more performing way to do it so I stumbled upon Google’s Protobuf library. I found a portable .NET version, which supports .NET 4.5 and I imported it in my project via NuGet.
I used this NuGet package to be specific: https://www.nuget.org/packages/protobuf-portable-net/2.0.0.668/
On client-side I’m getting some sort of runtime exception when executing the command which is using in fact the Protobuf lib.
The error is something like Could not load assembly System.Runtime.
What’s wrong with my code?
Maybe I misunderstood and I can’t use only portable versions on client side but it’s something linked with their references. I guess maybe System.Runtime is one of those who can’t be run.
Can somebody explain to me the logic behind what it can be used on client side and what not?
Thank you in advance.
P.S.If it useful I can provide my code or even the complete solution.