Skip to content

2.1.12: net461 targets file references removed win-arm native asset, breaks .NET Framework builds #678

Description

@tschettler

Description

In version 2.1.12, the win-arm native binary was intentionally removed from the nuspec/package contents (commit f32a1de), but the buildTransitive\net461\SQLitePCLRaw.lib.e_sqlite3.targets file was not updated to remove the corresponding <Content> item that references it. This causes build failures for any .NET Framework project that transitively pulls this package.

Root Cause

In commit f32a1de, the nuspec correctly removed win-arm (and win10-arm, win10-arm64, win10-x64, win10-x86):

-    <file src="$cb_bin_path$\e_sqlite3\win\v142\plain\arm\e_sqlite3.dll" target="runtimes\win-arm\native\e_sqlite3.dll" />

And gen_lib_nuspecs/Program.cs commented out the win-arm entry:

-        write_nuspec_file_entry_native_win(lib, win_toolset, "plain", "arm", "win-arm", f);
+        //write_nuspec_file_entry_native_win(lib, win_toolset, "plain", "arm", "win-arm", f);

However, the targets file at src/SQLitePCLRaw.lib.e_sqlite3/net461/SQLitePCLRaw.lib.e_sqlite3.targets (which is shipped in the package at buildTransitive\net461\) still contains:

<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-arm\native\e_sqlite3.dll">
  <Link>runtimes\win-arm\native\e_sqlite3.dll</Link>
  ...
</Content>

Runtimes comparison

In 2.1.11 but removed from 2.1.12:

  • win-arm
  • win10-arm
  • win10-arm64
  • win10-x64
  • win10-x86

The net461 targets file still references win-arm (and possibly others).

Impact

Building a multi-target project (e.g. net472;net10.0) that references Microsoft.Data.Sqlite 10.0.11 (which transitively pulls SQLitePCLRaw.lib.e_sqlite3 2.1.12) fails during the net472 build:

Could not copy the file "C:\Users\...\.nuget\packages\sqlitepclraw.lib.e_sqlite3\2.1.12\runtimes\win-arm\native\e_sqlite3.dll" because it was not found.

Workaround

Pin Microsoft.Data.Sqlite to version 10.0.10, which pulls SQLitePCLRaw.lib.e_sqlite3 2.1.11.

Related

Microsoft.Data.Sqlite 10.0.11 (in dotnet/efcore) updated its dependency to pull SQLitePCLRaw.bundle_e_sqlite3 2.1.12, which references this broken SQLitePCLRaw.lib.e_sqlite3 2.1.12 package. Even after this targets file is fixed here, Microsoft.Data.Sqlite would need a servicing release to pick up the corrected package version.

Expected fix

Update the net461 targets file to remove references to win-arm (and any other removed runtimes like win10-*), matching what the nuspec already does.

Environment

  • .NET SDK: 10.0
  • Project target frameworks: net472;net10.0
  • OS: Windows x64
  • SQLitePCLRaw.lib.e_sqlite3: 2.1.12 (broken), 2.1.11 (works)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions