-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asp.net core SignalR 3.1.9 incompatible with System.Text.Json 5 #27519
Comments
This issue is only happening in a client application right? Where you kept the SignalR client as 3.1.x and moved other dependencies to 5.0? |
No, this is on the server side. The exception occurs inside the method I linked ( |
Yeah I know where the issue is. How are you getting this in a server application? Are you targeting netcoreapp3.1 and pulling in 5.0 dependencies? |
I am targeting netcoreapp3.1 in an asp.net core project and updated Entity Framework Core to version 5 RC2, this in turn pulls in the latest System.Text.Json as a dependent package. |
Ok thanks, so two different scenarios are broken with the System.Text.Json changes. That'll help us prioritize. Side-note: Why aren't you targeting net5.0 if you're pulling in 5.0 packages? |
I am currently testing the upgrade path for several parts of our code base towards net5.0, this change was part of testing whether a list of libraries we use can be upgraded without a problem. (Some of our services run on azure, and since we are not deploying as self-contained at the moment I am not sure I can easily switch over immediately). I am pretty confident though that there will still remain a lot of signalR 3.x services running that will probably at some point in the future have implicit references to System.Text.Json in the latest version. Since EF core 5 runs on .net core 3.1 this will probably happen very quickly, since we want to use a few of the new features without a full .net5 upgrade. |
Looks like we need to make a fix to 3.1 in SignalR to not pass null to the JsonSerializerTo/From. |
Done via #27534 |
@BrennanConroy Hey Brennan, just wanted to say thanks for the quick replies and the quick fix. Your work is appreciated! |
In
System.Text.Json
the API will change in version 5. Especially thetype
parameter inJsonSerializer.Serialize
. The function now throws an exception whennull
is passed. (see this issue)This is fixed in the latest SignalR 5 code (see e.g. the null check before this call here) but since
System.Text.Json
is a very common dependency once updated SignalR 3.1.9 will no longer work.Will there be a new 3.x release to fix this problem? I already encountered that problem when testing an update to the latest EF 5 RC version.
The text was updated successfully, but these errors were encountered: