Skip to content

Modernize to .NET 8 + SQLite (fix Windows 11 Access/ACE-OLEDB errors)#41

Open
johnli125308250-design wants to merge 1 commit into
feelfar:masterfrom
johnli125308250-design:modernize-net8-sqlite
Open

Modernize to .NET 8 + SQLite (fix Windows 11 Access/ACE-OLEDB errors)#41
johnli125308250-design wants to merge 1 commit into
feelfar:masterfrom
johnli125308250-design:modernize-net8-sqlite

Conversation

@johnli125308250-design

Copy link
Copy Markdown

Why

On Windows 11 the app frequently fails because the Access DB is accessed via Microsoft.ACE.OLEDB.12.0, which needs the Access Database Engine redistributable and a matching bitness (x64 app vs 32-bit Office) — the common "provider is not registered" errors. .NET Framework 4.8 itself runs fine on Win11; the database driver is the root cause.

What

  • Access -> embedded SQLite (varManager.sqlite): no driver install, no bitness issues. The VS typed-DataSet TableAdapters were reimplemented on System.Data.SQLite with the same public method signatures, so all Forms code is unchanged. The two Access saved queries (installedScenes, varsView) are recreated as SQLite views.
  • .NET Framework 4.8 -> .NET 8 (net8.0-windows, SDK-style): varManager + DragNDrop ported; MMDLoader net6 -> net8. LoadScene is intentionally kept on .NET 3.5 (it is injected into VaM's Unity/Mono and must stay).
  • Vendored DgvFilterPopup (CPOL, from farosch/DgvFilterPopup) — the original ..\DgvFilterPopup project reference was missing from the repo, so the solution could not build.
  • One-time migration tool (Settings dialog, or varManager.exe --migrate) imports an existing varManager.mdb into SQLite via ACE OLEDB. Verified on a real ~358k-row DB in ~2.6s.
  • .NET 8 behavior-diff fixes: Process.Start UseShellExecute=true; DpiUnaware to keep the original layout; virtual-list teardown crash on close; deterministic GDI bitmap disposal; cache folder resolved from the exe dir.
  • UX: double-buffered grid scrolling, lifted the 500-row batch caps, single gate for the shared BackgroundWorker.

Full write-up & verification in MODERNIZATION.md. Built with the .NET 8 SDK only (no VS needed): dotnet build varManager.sln -c Release.

Notes

  • This is a large change — happy to split it into smaller PRs (e.g. SQLite first, then the .NET 8 port) if you prefer.
  • The repo currently has no LICENSE file — would you be OK clarifying the license / whether you are happy taking this upstream? I want to respect your intent. 🙏
  • Thanks for varManager — it is a great tool, this just keeps it running cleanly on Win11.

Replace the Access/Jet (ACE OLEDB) database with embedded SQLite and port the
app from .NET Framework 4.8 to .NET 8 (net8.0-windows), fixing the frequent
"provider is not registered" failures on Windows 11 while preserving features.

Database
- Access varManager.mdb -> embedded SQLite varManager.sqlite (no driver
  install, no x86/x64 bitness conflicts).
- VS typed-DataSet TableAdapters reimplemented on System.Data.SQLite with the
  SAME public method signatures, so all Forms code is unchanged.
- Access saved queries (installedScenes, varsView) recreated as SQLite views;
  CRUD via SQLiteCommandBuilder, one transaction per batch.
- DB lives next to the exe when writable, else %LOCALAPPDATA%\varManager.

Framework
- varManager + DragNDrop -> SDK-style net8.0-windows; MMDLoader net6 -> net8.
- LoadScene intentionally kept on .NET 3.5 (injected into VaM Unity/Mono).
- Vendored DgvFilterPopup (CPOL); original external project ref was missing.

Data migration
- One-time importer (Settings dialog + --migrate) copies an existing
  varManager.mdb into SQLite via ACE OLEDB. Verified on a real ~358k-row DB.

.NET 8 behavior-diff fixes
- Process.Start UseShellExecute=true to open URLs/folders.
- DpiUnaware so fixed-size WinForms layouts are not re-scaled/clipped.
- Virtual-list teardown crash on close; deterministic GDI bitmap disposal;
  cache folder resolved from the exe dir.

UX
- Double-buffered grid scrolling; lifted 500-row batch caps; single gate for
  the shared BackgroundWorker (no more "busy" crashes).

See MODERNIZATION.md for details and verification.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant