Skip to content

Build AnyCPU instead of x86 so the plugin loads in 64-bit HDT - #2

Open
dtroest wants to merge 1 commit into
Zulut30:mainfrom
dtroest:fix/anycpu-build
Open

Build AnyCPU instead of x86 so the plugin loads in 64-bit HDT#2
dtroest wants to merge 1 commit into
Zulut30:mainfrom
dtroest:fix/anycpu-build

Conversation

@dtroest

@dtroest dtroest commented Aug 23, 2026

Copy link
Copy Markdown

Hi — thanks for the plugin, the collection export is exactly what I needed.

I ran into #1 and this fixes it.

The problem

The plugin is pinned to x86 in three places: the default Platform in
HdtCollectionExporter.csproj, both configuration PropertyGroups in the same
file, and build.ps1 (/p:Platform=x86, plus /platform:x86 in the fallback
compiler path).

Hearthstone Deck Tracker 1.53.x runs as a 64-bit process, so it refuses the
resulting 32-bit assembly:

Error|PluginManager.GetModule >> Error loading ...\Plugins\HdtCollectionExporter.dll:
System.BadImageFormatException: An attempt was made to load a program with an incorrect format.

The plugin never shows up under Options > Tracker > Plugins. Rebuilding from
source does not help, because build.ps1 forces x86 again — which is what the
reporter in #1 also found.

The fix

Switch to AnyCPU everywhere it is pinned: the project file, the solution, and
build.ps1. The output moves from bin\x86\<Config>\ to bin\<Config>\, so the
three docs that name that path are updated to match.

No source files are changed, and the WPF UI is untouched.

Verification

I have been running an AnyCPU build of this code against HDT 1.53.9 since July —
it loads and the export works (8,107 cards on the first run). The resulting
assembly is IL-only:

ILONLY = True
32BITREQUIRED = False
32BITPREFERRED = False

which is what lets it load in both 32-bit and 64-bit hosts.

One thing I could not test: I do not have a Windows build environment set up, so
build.ps1 itself is unverified end-to-end on this branch. The platform flags are
changed consistently, but a build.ps1 run on your side would be worth doing
before merging. Happy to adjust if something in the fallback compiler path needs
more.

Fixes #1

The plugin is hardcoded to x86 in the project file, the solution and
build.ps1. Hearthstone Deck Tracker 1.53.x runs as a 64-bit process, so
it rejects the resulting 32-bit assembly with

    System.BadImageFormatException: An attempt was made to load a program
    with an incorrect format.

and the plugin never appears in Options > Tracker > Plugins. Rebuilding
from source does not help, because build.ps1 passes /p:Platform=x86 (and
/platform:x86 in the fallback compiler path), so the output is x86 again.

Switch the platform to AnyCPU everywhere it is pinned:

- HdtCollectionExporter.csproj: default Platform, both configuration
  PropertyGroups, PlatformTarget and Prefer32Bit. Output moves from
  bin\x86\<Config>\ to bin\<Config>\.
- HdtCollectionExporter.sln: solution and project configurations.
- build.ps1: /p:Platform="Any CPU", /platform:anycpu, and the obj/bin
  paths that mirrored the old layout.
- README.md, docs/INSTALL.en.md, docs/INSTALL.ru.md: the documented path
  to the built DLL follows the new output location.

No source files are touched. The assembly is IL-only after this change
(ILONLY set, 32BITREQUIRED and 32BITPREFERRED clear), so it loads in
both 32-bit and 64-bit hosts.

Fixes Zulut30#1
@vercel

vercel Bot commented Aug 23, 2026

Copy link
Copy Markdown

@dtroest is attempting to deploy a commit to the Zulut 's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8ac9ac9b-f672-42de-ac24-0b28ba789d38


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Plugin never appears in HDT plugin list (BadImageFormatException, and still fails after local x86 rebuild)

1 participant