Skip to content

Commit 5d41412

Browse files
adrianhallahall
andauthored
fix: remove unused SQLite native asset warning in TodoApp.BlazorWasm.Client (#560)
CommunityToolkit.Datasync.Client depends unconditionally on Microsoft.EntityFrameworkCore.Sqlite, which transitively adds a browser-wasm NativeFileReference for SourceGear.sqlite3's e_sqlite3.a via SQLitePCLRaw.bundle_e_sqlite3 (pinned in this project only to resolve NU1903, see #492). This client never uses SQLite/ OfflineDbContext (verified: no references to DbContext, Sqlite, or OfflineTable anywhere in the project), so the native asset is dead weight and trips a benign, code-less warning from the SDK's WorkloadManifest.targets: warning : @(NativeFileReference) is not empty, but the native references won't be linked in, because neither $(WasmBuildNative), nor $(RunAOTCompilation) are 'true'. Root cause traced to SourceGear.sqlite3's buildTransitive targets, which unconditionally add the native asset whenever $(RuntimeIdentifier) == 'browser-wasm', independent of which SQLitePCLRaw.bundle_e_sqlite3 version resolves. Since the warning has no diagnostic code it can't be suppressed via NoWarn, so instead remove the specific unused NativeFileReference item before the SDK's _CheckBrowserWorkloadNeededButNotAvailable target runs. Verified locally (dotnet restore + build samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.sln, matching build-samples-todoapp-blazor-wasm.yml): warning present twice in a clean build before this change, zero occurrences after, with an otherwise identical Debug build (0 Warning(s), 0 Error(s)). Also verified the root Datasync.Toolkit.sln still restores/builds clean and CommunityToolkit.Datasync.Client.Test passes 1432/1432 (unaffected by this samples-only change, but confirms no regression). Fixes #523 Co-authored-by: ahall <ahall@cloudflare.com>
1 parent 448c446 commit 5d41412

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

samples/todoapp-blazor-wasm/TodoApp.BlazorWasm.Client/TodoApp.BlazorWasm.Client.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,18 @@
1919
<ProjectReference Include="..\TodoApp.BlazorWasm.Shared\TodoApp.BlazorWasm.Shared.csproj" />
2020
</ItemGroup>
2121

22+
<!--
23+
CommunityToolkit.Datasync.Client depends unconditionally on Microsoft.EntityFrameworkCore.Sqlite,
24+
which transitively adds a browser-wasm NativeFileReference for SourceGear.sqlite3's e_sqlite3.a
25+
(via SQLitePCLRaw.bundle_e_sqlite3, pinned above only to resolve NU1903 - see #492). This app never
26+
uses SQLite/OfflineDbContext, so the native asset is unused; remove it before the SDK's browser
27+
workload check runs to avoid a benign, code-less "NativeFileReference is not empty..." warning
28+
from WorkloadManifest.targets. See #523.
29+
-->
30+
<Target Name="RemoveUnusedSqliteNativeFileReference" BeforeTargets="_CheckBrowserWorkloadNeededButNotAvailable">
31+
<ItemGroup>
32+
<NativeFileReference Remove="@(NativeFileReference)" Condition="'%(Filename)%(Extension)' == 'e_sqlite3.a'" />
33+
</ItemGroup>
34+
</Target>
35+
2236
</Project>

0 commit comments

Comments
 (0)