-
Notifications
You must be signed in to change notification settings - Fork 21
[ECO-4567] Support msgpack #1311
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
base: main
Are you sure you want to change the base?
Changes from all commits
e8831fe
86d5060
e6da13c
3b2765c
de00d64
2838467
4a04264
14423cd
73d7fce
b7b7995
da42072
dd138de
c49d355
a241793
b3002d4
8068059
585ee7d
f19dee1
a1592b2
8b0cced
85f0040
0e9b10d
e9c9a04
0532d66
e2aac5e
477e4d9
3d56db4
4fdf426
39a2c58
5d7a02f
a1ceae7
3246e3e
e0b038c
9385d46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,13 +15,15 @@ | |
| <NuGetPackageImportStamp> | ||
| </NuGetPackageImportStamp> | ||
| <TargetFrameworkProfile /> | ||
| <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> | ||
| <CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)Generated</CompilerGeneratedFilesOutputPath> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
| <DebugSymbols>true</DebugSymbols> | ||
| <DebugType>full</DebugType> | ||
| <Optimize>false</Optimize> | ||
| <OutputPath>bin\Debug\</OutputPath> | ||
| <DefineConstants>TRACE;DEBUG;EXCLUDE_MSGPACK</DefineConstants> | ||
| <DefineConstants>TRACE;DEBUG</DefineConstants> | ||
| <ErrorReport>prompt</ErrorReport> | ||
| <WarningLevel>4</WarningLevel> | ||
| <RunCodeAnalysis>true</RunCodeAnalysis> | ||
|
|
@@ -57,26 +59,52 @@ | |
| <!-- Fix for DeterministicSourcePaths in CI environments --> | ||
| <!-- See: https://github.com/dotnet/sourcelink/issues/572 --> | ||
| <ItemGroup> | ||
| <SourceRoot Include="$(MSBuildThisFileDirectory)..\..\"/> | ||
| <SourceRoot Include="$(MSBuildThisFileDirectory)..\..\" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <Reference Include="MessagePack, Version=3.1.4.0, Culture=neutral, PublicKeyToken=b4a0369545f0a1be"> | ||
| <HintPath>..\packages\MessagePack.3.1.4\lib\netstandard2.0\MessagePack.dll</HintPath> | ||
| <Private>True</Private> | ||
| </Reference> | ||
| <Reference Include="MessagePack.Annotations, Version=3.1.4.0, Culture=neutral, PublicKeyToken=b4a0369545f0a1be, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\MessagePack.Annotations.3.1.4\lib\netstandard2.0\MessagePack.Annotations.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="Microsoft.NET.StringTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\Microsoft.NET.StringTools.17.11.4\lib\netstandard2.0\Microsoft.NET.StringTools.dll</HintPath> | ||
| </Reference> | ||
|
Comment on lines
+65
to
+77
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify: Major version bumps for framework compatibility. The addition of System.Runtime.CompilerServices.Unsafe 6.0.0 (up from 4.5.0) and System.Collections.Immutable 8.0.0 represent significant version changes. Although these are dependencies of MessagePack 3.1.4, confirm:
Consider running target framework compatibility checks as part of testing. Also applies to: 82-107 🌐 Web query: 💡 Result: Yes — System.Runtime.CompilerServices.Unsafe 6.0.0 is compatible with .NET Framework 4.6.2. The NuGet package for 6.0.0 includes a net46.1 target (and netstandard2.0), which is compatible with 4.6.2 (4.6.2 >= 4.6.1). For later 6.1.x releases the package explicitly lists net462 as a target. [1][2] Sources:
🌐 Web query: 💡 Result: Yes — System.Collections.Immutable 8.0.0 supports .NET Framework. The NuGet package lists .NETFramework 4.6.2 (and compatibility with 4.6.1/4.6.2+ / 4.7 / 4.7.1 / 4.7.2 / 4.8 / 4.8.1) and includes a net461 target; the .NETFramework build depends on System.Memory (>= 4.5.5) and System.Runtime.CompilerServices.Unsafe (>= 6.0.0). [1] Sources: 🌐 Web query: 💡 Result: MessagePack 3.1.4 (NuGet) — target framework requirements (summary)
Source: NuGet package metadata for MessagePack 3.1.4. [1] References 🏁 Script executed: #!/bin/bash
# Check the TargetFramework property in the .csproj file
grep -n "TargetFramework" src/IO.Ably.NETFramework/IO.Ably.NETFramework.csproj | head -5Length of output: 96 🏁 Script executed: #!/bin/bash
# Also check for any PropertyGroup with framework version
grep -n -A2 "PropertyGroup" src/IO.Ably.NETFramework/IO.Ably.NETFramework.csproj | grep -i "target\|framework" | head -10Length of output: 237 CRITICAL: MessagePack 3.1.4 targets .NET Framework 4.7.2, incompatible with project's 4.6.2 target. MessagePack 3.1.4 explicitly targets .NET Framework 4.7.2, but this project targets .NET Framework 4.6.2 (line 13: This change cannot proceed without either:
|
||
| <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="System" /> | ||
| <Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="System.Collections.Immutable, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\System.Collections.Immutable.8.0.0\lib\net462\System.Collections.Immutable.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="System.Core" /> | ||
| <Reference Include="System.Data" /> | ||
| <Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="System.Net.Http"> | ||
| <HintPath>..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Net.Http.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath> | ||
| <Reference Include="System.Numerics" /> | ||
| <Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="System.Threading.Channels, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\System.Threading.Channels.4.6.0\lib\netstandard2.0\System.Threading.Channels.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath> | ||
| <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath> | ||
| </Reference> | ||
| <Reference Include="System.Xml" /> | ||
| <Reference Include="System.Net" /> | ||
|
|
@@ -98,6 +126,8 @@ | |
| <Analyzer Include="..\packages\Microsoft.CodeQuality.Analyzers.2.9.6\analyzers\dotnet\cs\Humanizer.dll" /> | ||
| <Analyzer Include="..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" /> | ||
| <Analyzer Include="..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.dll" /> | ||
| <Analyzer Include="..\packages\MessagePackAnalyzer.3.1.4\analyzers\roslyn4.3\cs\MessagePack.SourceGenerator.dll" /> | ||
| <Analyzer Include="..\packages\MessagePackAnalyzer.3.1.4\analyzers\roslyn4.3\cs\MessagePack.Analyzers.CodeFixes.dll" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <ProjectReference Include="..\..\lib\delta-codec\IO.Ably.DeltaCodec\IO.Ably.DeltaCodec.csproj"> | ||
|
|
@@ -112,5 +142,7 @@ | |
| <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> | ||
| </PropertyGroup> | ||
| <Error Condition="!Exists('..\packages\Microsoft.CodeQuality.Analyzers.2.9.6\build\Microsoft.CodeQuality.Analyzers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeQuality.Analyzers.2.9.6\build\Microsoft.CodeQuality.Analyzers.props'))" /> | ||
| <Error Condition="!Exists('..\packages\MessagePackAnalyzer.3.1.4\build\MessagePackAnalyzer.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MessagePackAnalyzer.3.1.4\build\MessagePackAnalyzer.targets'))" /> | ||
| </Target> | ||
| <Import Project="..\packages\MessagePackAnalyzer.3.1.4\build\MessagePackAnalyzer.targets" Condition="Exists('..\packages\MessagePackAnalyzer.3.1.4\build\MessagePackAnalyzer.targets')" /> | ||
| </Project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,19 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <configuration> | ||
| <runtime> | ||
| <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
| <dependentAssembly> | ||
| <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/> | ||
| <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/> | ||
| <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> | ||
| <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> | ||
| </dependentAssembly> | ||
| <dependentAssembly> | ||
| <assemblyIdentity name="System.Threading.ThreadPool" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> | ||
| <bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/> | ||
| <assemblyIdentity name="System.Threading.ThreadPool" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> | ||
| <bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0" /> | ||
| </dependentAssembly> | ||
| <dependentAssembly> | ||
| <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> | ||
| <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> | ||
| </dependentAssembly> | ||
| </assemblyBinding> | ||
| </runtime> | ||
| <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration> | ||
| <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /></startup></configuration> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,21 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <packages> | ||
| <package id="ILRepack.Lib.MSBuild.Task" version="2.0.18" targetFramework="net461" /> | ||
| <package id="MessagePack" version="3.1.4" targetFramework="net462" /> | ||
| <package id="MessagePack.Annotations" version="3.1.4" targetFramework="net462" /> | ||
| <package id="MessagePackAnalyzer" version="3.1.4" targetFramework="net462" developmentDependency="true" /> | ||
| <package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net462" /> | ||
| <package id="Microsoft.CodeQuality.Analyzers" version="2.9.6" targetFramework="net461" developmentDependency="true" /> | ||
| <package id="Microsoft.NET.StringTools" version="17.11.4" targetFramework="net462" /> | ||
| <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net461" /> | ||
| <package id="StyleCop.Analyzers" version="1.1.118" targetFramework="net461" developmentDependency="true" /> | ||
| <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net461" /> | ||
| <package id="System.Buffers" version="4.5.1" targetFramework="net462" /> | ||
| <package id="System.Collections.Immutable" version="8.0.0" targetFramework="net462" /> | ||
| <package id="System.Memory" version="4.5.5" targetFramework="net462" /> | ||
| <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net462" /> | ||
| <package id="System.Reflection.Emit" version="4.7.0" targetFramework="net462" /> | ||
| <package id="System.Reflection.Emit.Lightweight" version="4.7.0" targetFramework="net462" /> | ||
| <package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net462" /> | ||
| <package id="System.Threading.Channels" version="4.6.0" targetFramework="net461" /> | ||
| <package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net461" /> | ||
| <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net461" /> | ||
| </packages> |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify MessagePack version 3.1.4 validity, security, and compatibility; consider using a version range.
The hard-pinned version "3.1.4" prevents consumers from automatically receiving patch updates or security fixes. Additionally, compatibility with older frameworks (net46, monoandroid, monotouch) and mobile platforms should be verified.
Consider using a version range instead of an exact version, such as
[3.1.4, 4.0.0)to allow patch updates while preventing breaking changes.Run the following script to verify the package version and check for security advisories:
Additionally, search the web for the latest MessagePack-CSharp documentation and compatibility information:
Also applies to: 27-27, 31-31, 35-35, 39-39, 44-44, 49-49
🏁 Script executed:
Length of output: 2816
🌐 Web query:
💡 Result:
Short answer: MessagePack-CSharp 3.1.4 targets .NETStandard 2.0 (and explicitly .NETFramework 4.7.2) and is compatible with Xamarin platforms. That means it requires a runtime that supports .NET Standard 2.0 — i.e. .NET Framework 4.6.1 or later — so it will NOT work on plain .NET Framework 4.0–4.6.0 without upgrading. NuGet also lists Xamarin (iOS/Mac/Android/TVOS/WatchOS) as compatible. [1][2]
If you must stay on .NET Framework 4.6.0, either upgrade the project to ≥4.6.1 (recommended) or use an older MessagePack release that supports that runtime. [1][3]
Sources:
Remove MessagePack 3.1.4 from the net46 target framework group; it requires .NET Framework 4.6.1+.
MessagePack 3.1.4 is valid and not affected by known security vulnerabilities. However, there is a critical compatibility issue: MessagePack 3.1.4 explicitly requires .NET Standard 2.0 support, which means .NET Framework 4.6.1 or later. The net46 target framework (4.6.0) falls below this minimum requirement and will fail to resolve this dependency.
Fix: Either remove the dependency from the net46 group (line 23) or upgrade that framework to net461. The dependency is compatible with Xamarin platforms and modern frameworks (net6.0, net7.0).
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, since
MessagePack 3.1.4supportsnetstandard2.0, we should be able to use it here right?Dependency resolution mechanism should automatically take care of resolving relevant dependencies based on netstandard2.0 right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sacOO7, unfortunately no—the dependency resolution mechanism will not automatically resolve this because .NET Framework 4.6.0 does not support .NET Standard 2.0.
Here's why:
The compatibility issue:
net46refers to .NET Framework 4.6.0What will happen:
When users try to install your package targeting
net46, NuGet will fail to resolve the MessagePack 3.1.4 dependency because the framework version is incompatible. The dependency resolver won't "fall back" to a compatible version automatically.Solutions:
Upgrade the target framework (recommended):
Remove MessagePack from the net46 group (if you must support .NET Framework 4.6.0):
net46group without MessagePacknet461group with MessagePackAdditional note:
The other target frameworks in your nuspec are fine:
monoandroid,Xamarin.iOS, andmonotouchall support .NET Standard 2.0netstandard2.0,net6.0, andnet7.0obviously support itI recommend upgrading to
net461since .NET Framework 4.6.0 is quite old (released 2015) and most users should be on 4.6.1+ by now.