The ASP.NET Core SignalR MessagePack Hub Protocol uses the MessagePack
NuGet package for MessagePack serialization. In ASP.NET Core 5.0, we will move from the 1.x version to the latest 2.x version. This is a breaking change for:
MessagePackHubProtocolOptions
5.0-preview1
Previously, ASP.NET Core SignalR used the MessagePack 1.x package to serialize/deserialize MessagePack messages.
Now, ASP.NET Core SignalR will use the MessagePack 2.x package to serialize/deserialize MessagePack messages.
We believe updating to MessagePack v2.x will add useful new functionality and allow us to stay current with the latest improvements in that package.
The new behavior will impact some aspects of message serialization and deserialization. See the guidance for migrating from 1.x to 2.x published by the MessagePack package authors. Specifically, there are behavioral changes to how DateTime values are serialized.
If you are using MessagePack directly in your application and using the SignalR MessagePack Hub Protocol, update your usage to adapt to any breaking changes in the 2.x release of MessagePack. The MessagePack package authors have published guidance for migrating from 1.x to 2.x.
ASP.NET
This is the discussion issue for the following announcement: https://github.com/aspnet/Announcements/issues/404
Special thanks to @tebeco for contributing this change!
(and @AArnott / @BrennanConroy for their advice and patience)
So for current LTS dotnet 3.1 we are bound to MessagePack 1.x family only, right? MessagePack 2.x is not compatible/supported until dotnet 5.x?
So we should stop updating nuget package to >=2.x
yes for SignalR 3.x, you cannot update to MessagePack
2.x
this is true ONLY if you use the MessagePackHubProtocol
for example if you only use the JsonHubProtocol
you do whatever you want as MessagePack
is a transitive if a specific nuget that is not referenced by default IIRC
so i would not say
So we should stop updating nuget package to >=2.x
I would rather say something like:
Until aspnetcore 5.x is release AND you need the MessagePackHubProtocol
then you need to set an explicit constraints on MessagePack
so that it is strictly inferior to 2.0.0
Version="[1.7.*, 2.0.0)"
that way you are still using a "declarative mode stating what you want" and on top of it you will get explicit dotnet restore
error if another third part tries to pull a superior version
@ChaosEngine Unfortunately yes, because of the breaking nature of the upgrade. The 3.1 LTS will continue to be on MessagePack 1.x.
We have a good relationship with the authors of that package though, and expect to be able to continue patching critical issues in the MessagePack 1.x series of packages for the duration of the LTS. However, as is always the case when using non-Microsoft components like MessagePack, that isn't something we can guarantee (which is also why the MessagePack Hub protocol ships in a separate NuGet package rather than in the core Framework).
Most helpful comment
Special thanks to @tebeco for contributing this change!