Comments (4)
can you check if that still happen on the latest package?
from signalr.
It does not happen anymore for Enums (good thing!), but still for unsigned numbers. I think I found the reason, see here: https://github.com/aspnet/Extensions/issues/1701
I`ll close this issue, since it is out of the scope of this repository. Hopefully it will be fixed in the next preview :)
from signalr.
Ok I got a littble bit confused with MessagePack and JSON because I tried both.
For MessagePack, both, enum
and uint
, do not work. I guess it is because MessagePack serializes the enum in an unexpected way. The JSON string passed to the On<T1, T2, ...>()
method in the HubConnection
class looks like the following (content of variable payloads[0]
):
MessagePack:
{"Id":1,"StringData":"Demo Data","UIntData":1,"EnumData":"Mode1"}
:
vs.
JSON:
{"Id":1,"StringData":"Demo Data","UIntData":1,"EnumData":"1"}
So, with MessagePack, the EnumData property is a string instead of a number.
With JSON-only transport, enum is working but uint
not. The reason seems to be in the SimpleJson serializer as written above.
I also tried with the brand new JsonSerializer in System.Text.Json.Serialization (JsonSerializer.Parse<DemoData>(jsonString);
. This serialize is able to handle uint
correctly, but I think it is only available in netcore3.0 apps.
In summary, I think the uint
issue is not your concern, but mabye the enum
issue. This is caused by combining underlying MessagePack serialization with Json.Deserialize<T>()
, since both handle enums differently.
from signalr.
Please check the test project now. I've added a sample of an enum : uint
that enumerate your case so it must work for you. No changes were made to the packages. Only the sample.
I'm closing the issue but feel free to ping back in case you fall in troubles.
Thanks!
from signalr.
Related Issues (20)
- Serverside example HOT 3
- JsRuntime on Server side HOT 1
- InvalidOperationException: JSRuntime must be set up correctly and must be an instance of JSRuntimeBase to use DotNetObjectRef. HOT 2
- Update to preview 8 HOT 1
- .net 3 preview 9 build error HOT 3
- Serialization Issue / Configuration HOT 6
- Cannot deserialize decimal with MessagePack and System.Text.Json HOT 1
- HubConnectionBuilder throws NullReferenceException HOT 6
- Support automatic reconnects and State on HubConnection HOT 4
- Non-generic overload of the On method? HOT 3
- Server Hub receives ValueTuple with default values HOT 2
- Why is this needed? HOT 1
- Preview 2 HOT 1
- Why JWT is being send in a query string parameter instead of its proper header? HOT 1
- Can't serialize poco class HOT 5
- Upgrading Blazor WebAssembly to 3.1.0-preview4.19579.2 leads to an error: Could not find 'BlazorExtensions' in 'window'. HOT 10
- Upgrading to .NET Standard 2.1 in the Blazor client-side project causes a runtime error HOT 1
- This might be obsolete now HOT 1
- examples needed
- How can we add support for Additional languages?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from signalr.