CurtHagenlocher opened a new issue, #5001:
URL: https://github.com/apache/arrow-adbc/issues/5001

   ### What happened?
   
   The `lib/net472/Apache.Arrow.Adbc.Testing.dll` in the nuget.org package 
`Apache.Arrow.Adbc.Testing` 1.0.0 references:
   
   ```
   System.Memory, Version=4.0.5.0, Culture=neutral, 
PublicKeyToken=cc7b13ffcd2ddd51
   ```
   
   Assembly version 4.0.5.0 ships in the System.Memory **4.6.3** package. 
However, the package's `.NETFramework4.7.2` dependency group doesn't list 
System.Memory. Its declared dependencies (`Apache.Arrow` 23.0.0, 
`System.Text.Json` 9.0.9, `System.Diagnostics.DiagnosticSource` 9.0.6, …) only 
require System.Memory ≥ 4.6.0 / ≥ 4.5.5. A consumer that references 
`Apache.Arrow.Adbc.Testing` 1.0.0 from a net472 project therefore restores 
System.Memory **4.6.0** (assembly 4.0.2.0) and gets:
   
   ```
   warning MSB3277: Found conflicts between different versions of 
"System.Memory" that could not be resolved.
     "System.Memory, Version=4.02.0.0" was chosen because it was primary and 
"System.Memory, Version=4.0.5.0" was not.
   ```
   
   At runtime this depends on binding redirects pointing *down* to 4.0.2.0.
   
   The other 1.0.0 / 23.0.0 assemblies are consistent with what they declare: 
`Apache.Arrow.Adbc` and `Apache.Arrow.Adbc.Client` (netstandard2.0) and 
`Apache.Arrow` / `Apache.Arrow.Scalars` / `Apache.Arrow.Operations` 23.0.0 
(net462) all reference System.Memory 4.0.2.0.
   
   `Apache.Arrow.Adbc.Testing.csproj` at `apache-arrow-adbc-25` doesn't 
reference System.Memory directly, so 4.6.3 presumably reaches the compile graph 
through a dependency that isn't flowed into the nuspec. Candidates are a 
`PrivateAssets="all"` reference, or a version only present in the build 
environment. I haven't pinned down which.
   
   ### How can we reproduce the bug?
   
   1. Create a project targeting `net472` with `<PackageReference 
Include="Apache.Arrow.Adbc.Testing" Version="1.0.0" />` (plus 
`Microsoft.NET.Test.Sdk` 18.11.0 and `Xunit.SkippableFact` 1.5.85 to satisfy 
its minimums).
   2. `dotnet build`. MSB3277 is reported for System.Memory.
   
   To inspect the reference directly (Windows PowerShell 5.1):
   
   ```powershell
   $a = 
[Reflection.Assembly]::ReflectionOnlyLoadFrom("<pkg>\lib\net472\Apache.Arrow.Adbc.Testing.dll")
   $a.GetReferencedAssemblies() | ? Name -eq 'System.Memory'   # -> 4.0.5.0
   ```
   
   Workaround in a consuming project:
   
   ```xml
   <PackageReference Include="System.Memory" Version="4.6.3" 
Condition="'$(TargetFramework)' == 'net472'" />
   ```
   
   Possible fixes: declare `System.Memory` (≥ 4.6.3) for net472 in the Testing 
project, or pin the build so it compiles against the same System.Memory version 
the declared dependencies resolve to.
   
   ### Environment/Setup
   
   - Package: `Apache.Arrow.Adbc.Testing` 1.0.0 from nuget.org (published 
2026-10-26)
   - Consumer TFM: net472; .NET SDK 11.0.100-rc.3, Windows 11
   - Found while moving adbc-drivers/snowflake from an arrow-adbc submodule to 
the 1.0 packages: https://github.com/adbc-drivers/snowflake/pull/241
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to